diff --git a/webapp/components/features/FollowList.spec.js b/webapp/components/features/FollowList.spec.js index ea9eeaa2f..f07dffa5f 100644 --- a/webapp/components/features/FollowList.spec.js +++ b/webapp/components/features/FollowList.spec.js @@ -75,6 +75,40 @@ describe('FollowList.vue', () => { }), ) }) + + describe('given a user without connections', () => { + ;['following', 'followedBy'].forEach((type) => + describe(`and type=${type}`, () => { + let wrapper + + beforeAll(() => { + wrapper = mount(FollowList, { + store, + mocks: { + $t: jest.fn().mockReturnValue('has no connections'), + }, + localVue, + propsData: { + user: { + ...propsData.user, + followedByCount: 0, + followingCount: 0, + followedBy: [], + following: [], + }, + type, + }, + }) + }) + + it('displays ne no-follower message', () => { + expect(wrapper.find('.no-connections-message').text()).toBe( + `${user.name} ${wrapper.vm.$t(`profile.network.${type}Nobody`)}`, + ) + }) + }), + ) + }) }) }) diff --git a/webapp/components/features/FollowList.story.js b/webapp/components/features/FollowList.story.js index 36a267071..dfd5a3b85 100644 --- a/webapp/components/features/FollowList.story.js +++ b/webapp/components/features/FollowList.story.js @@ -84,6 +84,21 @@ const allConnectionsUser = { storiesOf('FollowList', module) .addDecorator(withA11y) .addDecorator(helpers.layout) + .add('without connections', () => { + const user = { + ...sevenConnectionsUser, + followedBy: [], + followedByCount: 0, + } + return { + components: { FollowList }, + store: helpers.store, + data() { + return { user } + }, + template: ``, + } + }) .add('with up to 7 connections', () => { const user = sevenConnectionsUser return { @@ -94,7 +109,6 @@ storiesOf('FollowList', module) user, } }, - template: ``, } }) @@ -109,7 +123,6 @@ storiesOf('FollowList', module) user, } }, - template: ``, } }) diff --git a/webapp/components/features/FollowList.vue b/webapp/components/features/FollowList.vue index b03c61a6c..eb9de7f2a 100644 --- a/webapp/components/features/FollowList.vue +++ b/webapp/components/features/FollowList.vue @@ -1,10 +1,13 @@ - @@ -133,6 +131,10 @@ export default {