diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-04 18:12:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-04 18:12:07 +0300 |
commit | a155ff5671d06afd4c219a49b6c9fd673af69876 (patch) | |
tree | ea9f3422fcfe751f954561ff579569ba9a742eb3 /spec/frontend/invite_members/components | |
parent | 157061839634d24bdb937316373f35bf1fb1f71e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/invite_members/components')
-rw-r--r-- | spec/frontend/invite_members/components/members_token_select_spec.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/frontend/invite_members/components/members_token_select_spec.js b/spec/frontend/invite_members/components/members_token_select_spec.js index a4b8a8b0197..1cda9853ccd 100644 --- a/spec/frontend/invite_members/components/members_token_select_spec.js +++ b/spec/frontend/invite_members/components/members_token_select_spec.js @@ -12,6 +12,7 @@ const placeholder = 'Search for a member'; const user1 = { id: 1, name: 'John Smith', username: 'one_1', avatar_url: '' }; const user2 = { id: 2, name: 'Jane Doe', username: 'two_2', avatar_url: '' }; const allUsers = [user1, user2]; +const handleEnterSpy = jest.fn(); const createComponent = (props) => { return shallowMount(MembersTokenSelect, { @@ -22,7 +23,11 @@ const createComponent = (props) => { ...props, }, stubs: { - GlTokenSelector: stubComponent(GlTokenSelector), + GlTokenSelector: stubComponent(GlTokenSelector, { + methods: { + handleEnter: handleEnterSpy, + }, + }), }, }); }; @@ -173,6 +178,14 @@ describe('MembersTokenSelect', () => { }); }); }); + + it('allows tab to function as enter', () => { + tokenSelector.vm.$emit('text-input', 'username'); + + tokenSelector.vm.$emit('keydown', new KeyboardEvent('keydown', { key: 'Tab' })); + + expect(handleEnterSpy).toHaveBeenCalled(); + }); }); describe('when user is selected', () => { |