diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 06:12:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-08 06:12:29 +0300 |
commit | 746488c848df9868601d0db51a5d3da65e29e3b6 (patch) | |
tree | d7b55070ad21091c2663623e59566df2692c7047 /spec/frontend/vue_shared/components/entity_select | |
parent | ca23d770bd782ceca306e4a95054dc62bd32ecfd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared/components/entity_select')
-rw-r--r-- | spec/frontend/vue_shared/components/entity_select/entity_select_spec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/entity_select/entity_select_spec.js b/spec/frontend/vue_shared/components/entity_select/entity_select_spec.js index fa2e09b6b9f..6e2e854adae 100644 --- a/spec/frontend/vue_shared/components/entity_select/entity_select_spec.js +++ b/spec/frontend/vue_shared/components/entity_select/entity_select_spec.js @@ -122,6 +122,12 @@ describe('EntitySelect', () => { }); describe('once a group is selected', () => { + it('emits `input` event with the select value', async () => { + createComponent(); + await selectGroup(); + expect(wrapper.emitted('input')[0]).toEqual(['1']); + }); + it(`uses the selected group's name as the toggle text`, async () => { createComponent(); await selectGroup(); @@ -146,6 +152,16 @@ describe('EntitySelect', () => { expect(findListbox().props('toggleText')).toBe(defaultToggleText); }); + + it('emits `input` event with `null` on reset', async () => { + createComponent(); + await selectGroup(); + + findListbox().vm.$emit('reset'); + await nextTick(); + + expect(wrapper.emitted('input')[2]).toEqual([null]); + }); }); }); |