From 0b7e0fbc4b540156f78c27c1bd123576754e98b2 Mon Sep 17 00:00:00 2001 From: elweyn Date: Tue, 7 Mar 2023 13:16:38 +0100 Subject: [PATCH 1/3] Change Infinity to exact count. --- webapp/components/features/ProfileList/FollowList.vue | 2 +- webapp/pages/profile/_id/_slug.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/components/features/ProfileList/FollowList.vue b/webapp/components/features/ProfileList/FollowList.vue index 7e626308b..e04b4003e 100644 --- a/webapp/components/features/ProfileList/FollowList.vue +++ b/webapp/components/features/ProfileList/FollowList.vue @@ -6,7 +6,7 @@ :allProfilesCount="allConnectionsCount" :profiles="connections" :loading="loading" - @fetchAllProfiles="$emit('fetchAllConnections', type)" + @fetchAllProfiles="$emit('fetchAllConnections', type, allConnectionsCount)" /> diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index a2b959b6d..06e95abb4 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -384,9 +384,9 @@ export default { this.user.followedByCurrentUser = followedByCurrentUser this.user.followedBy = followedBy }, - fetchAllConnections(type) { - if (type === 'following') this.followingCount = Infinity - if (type === 'followedBy') this.followedByCount = Infinity + fetchAllConnections(type, count) { + if (type === 'following') this.followingCount = count + if (type === 'followedBy') this.followedByCount = count }, }, apollo: { From b15d2ff25221f6889be9cb1bd2403f473ff5d6f0 Mon Sep 17 00:00:00 2001 From: elweyn Date: Mon, 13 Mar 2023 14:10:16 +0100 Subject: [PATCH 2/3] Add user['Count'] to fetchAllConntections tests. --- webapp/components/features/ProfileList/FollowList.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/components/features/ProfileList/FollowList.spec.js b/webapp/components/features/ProfileList/FollowList.spec.js index 07214ae38..1c657402f 100644 --- a/webapp/components/features/ProfileList/FollowList.spec.js +++ b/webapp/components/features/ProfileList/FollowList.spec.js @@ -74,7 +74,7 @@ describe('FollowList.vue', () => { expect(wrapper.vm.allConnectionsCount).toBe(user.followingCount) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.following.length) - expect(wrapper.emitted('fetchAllConnections')).toEqual([['following']]) + expect(wrapper.emitted('fetchAllConnections')).toEqual([['following', user['followingCount']]]) }) }) @@ -85,7 +85,7 @@ describe('FollowList.vue', () => { expect(wrapper.vm.allConnectionsCount).toBe(user.followedByCount) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.followedBy.length) - expect(wrapper.emitted('fetchAllConnections')).toEqual([['followedBy']]) + expect(wrapper.emitted('fetchAllConnections')).toEqual([['followedBy', user['followedByCount']]]) }) }) }) From fdf5b1403c47563930c8e43e4dc8b5b9518c8059 Mon Sep 17 00:00:00 2001 From: elweyn Date: Mon, 13 Mar 2023 15:37:28 +0100 Subject: [PATCH 3/3] fix linting rules --- webapp/components/features/ProfileList/FollowList.spec.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/components/features/ProfileList/FollowList.spec.js b/webapp/components/features/ProfileList/FollowList.spec.js index 1c657402f..3398b0993 100644 --- a/webapp/components/features/ProfileList/FollowList.spec.js +++ b/webapp/components/features/ProfileList/FollowList.spec.js @@ -74,7 +74,9 @@ describe('FollowList.vue', () => { expect(wrapper.vm.allConnectionsCount).toBe(user.followingCount) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.following.length) - expect(wrapper.emitted('fetchAllConnections')).toEqual([['following', user['followingCount']]]) + expect(wrapper.emitted('fetchAllConnections')).toEqual([ + ['following', user.followingCount], + ]) }) }) @@ -85,7 +87,9 @@ describe('FollowList.vue', () => { expect(wrapper.vm.allConnectionsCount).toBe(user.followedByCount) expect(wrapper.findAll('.user-teaser')).toHaveLength(user.followedBy.length) - expect(wrapper.emitted('fetchAllConnections')).toEqual([['followedBy', user['followedByCount']]]) + expect(wrapper.emitted('fetchAllConnections')).toEqual([ + ['followedBy', user.followedByCount], + ]) }) }) })