From 4589466917c5f30a6c3cce97c839c7fecf069a34 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 30 Aug 2018 16:34:24 +0300 Subject: fixup! Added logic to process reply to favorite request and update likes counter accordingly. Should fix some of cases of doubled likes and likes counter not decrementing. --- test/unit/specs/modules/statuses.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/unit/specs/modules/statuses.spec.js') diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js index ba459b38..1666ef5d 100644 --- a/test/unit/specs/modules/statuses.spec.js +++ b/test/unit/specs/modules/statuses.spec.js @@ -264,7 +264,7 @@ describe('The Statuses module', () => { expect(state.timelines.public.visibleStatuses[0].fave_num).to.eql(1) expect(state.timelines.public.maxId).to.eq(favorite.id) - // If something is favorited by the current user, it also sets the 'favorited' property + // If something is favorited by the current user, it also sets the 'favorited' property but does not increment counter to avoid over-counting. Counter is incremented (updated, really) via response to the favorite request. const user = { id: 1 } @@ -281,7 +281,7 @@ describe('The Statuses module', () => { mutations.addNewStatuses(state, { statuses: [ownFavorite], showImmediately: true, timeline: 'public', user }) expect(state.timelines.public.visibleStatuses.length).to.eql(1) - expect(state.timelines.public.visibleStatuses[0].fave_num).to.eql(2) + expect(state.timelines.public.visibleStatuses[0].fave_num).to.eql(1) expect(state.timelines.public.visibleStatuses[0].favorited).to.eql(true) }) -- cgit v1.2.3-70-g09d2 From 42584b1a347fe924722d318113e6341160d70aa4 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 30 Aug 2018 16:52:38 +0300 Subject: fixup! fixup! Added logic to process reply to favorite request and update likes counter accordingly. Should fix some of cases of doubled likes and likes counter not decrementing. --- test/unit/specs/modules/statuses.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/unit/specs/modules/statuses.spec.js') diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js index 1666ef5d..7d403312 100644 --- a/test/unit/specs/modules/statuses.spec.js +++ b/test/unit/specs/modules/statuses.spec.js @@ -247,7 +247,7 @@ describe('The Statuses module', () => { in_reply_to_status_id: '1', // The API uses strings here... uri: 'tag:shitposter.club,2016-08-21:fave:3895:note:773501:2016-08-21T16:52:15+00:00', text: 'a favorited something by b', - user: {} + user: { id: 99 } } mutations.addNewStatuses(state, { statuses: [status], showImmediately: true, timeline: 'public' }) -- cgit v1.2.3-70-g09d2