diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-27 15:16:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-27 15:16:04 +0300 |
commit | 5cb0fa35e709bcd7f9d69e050010e44092a48623 (patch) | |
tree | 9a10a2a58b3129b6dae59d2aa320f00b1e4a2953 /spec/frontend/vue_shared | |
parent | 996683657578757cf42ef7478a5c3b9874b312f0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared')
-rw-r--r-- | spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js index 1754292cb63..075cb753301 100644 --- a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js +++ b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js @@ -148,6 +148,13 @@ describe('UserAvatarList', () => { expect(links.length).toEqual(TEST_BREAKPOINT); }); + it('does not emit any event on mount', async () => { + factory(); + await nextTick(); + + expect(wrapper.emitted()).toEqual({}); + }); + describe('with expand clicked', () => { beforeEach(() => { factory(); @@ -160,13 +167,25 @@ describe('UserAvatarList', () => { expect(links.length).toEqual(props.items.length); }); - it('with collapse clicked, it renders avatars up to breakpoint', async () => { - clickButton(); + it('emits the `expanded` event', () => { + expect(wrapper.emitted('expanded')).toHaveLength(1); + }); - await nextTick(); - const links = wrapper.findAllComponents(UserAvatarLink); + describe('with collapse clicked', () => { + beforeEach(() => { + clickButton(); + }); + + it('renders avatars up to breakpoint', async () => { + await nextTick(); + const links = wrapper.findAllComponents(UserAvatarLink); + + expect(links.length).toEqual(TEST_BREAKPOINT); + }); - expect(links.length).toEqual(TEST_BREAKPOINT); + it('emits the `collapsed` event', () => { + expect(wrapper.emitted('collapsed')).toHaveLength(1); + }); }); }); }); |