diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-26 12:10:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-26 12:10:05 +0300 |
commit | 6f22c85c38b7a896178879172f4c0f82353308f8 (patch) | |
tree | 7b03dd7282e3b05f9ee8c78c50f52bec97bfc450 /spec/frontend/super_sidebar/components/global_search | |
parent | 8759459c84757589002830279dfe3872ffc852bd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/super_sidebar/components/global_search')
-rw-r--r-- | spec/frontend/super_sidebar/components/global_search/components/global_search_spec.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/frontend/super_sidebar/components/global_search/components/global_search_spec.js b/spec/frontend/super_sidebar/components/global_search/components/global_search_spec.js index eb8801f68c6..f78e141afad 100644 --- a/spec/frontend/super_sidebar/components/global_search/components/global_search_spec.js +++ b/spec/frontend/super_sidebar/components/global_search/components/global_search_spec.js @@ -1,4 +1,4 @@ -import { GlSearchBoxByType, GlToken, GlIcon } from '@gitlab/ui'; +import { GlModal, GlSearchBoxByType, GlToken, GlIcon } from '@gitlab/ui'; import Vue from 'vue'; import Vuex from 'vuex'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; @@ -87,6 +87,8 @@ describe('GlobalSearchModal', () => { ); }; + const findGlobalSearchModal = () => wrapper.findComponent(GlModal); + const findGlobalSearchForm = () => wrapper.findByTestId('global-search-form'); const findGlobalSearchInput = () => wrapper.findComponent(GlSearchBoxByType); const findScopeToken = () => wrapper.findComponent(GlToken); @@ -350,5 +352,21 @@ describe('GlobalSearchModal', () => { }); }); }); + + describe('Modal events', () => { + beforeEach(() => { + createComponent(); + }); + + it('should emit `shown` event when modal shown`', () => { + findGlobalSearchModal().vm.$emit('shown'); + expect(wrapper.emitted('shown')).toHaveLength(1); + }); + + it('should emit `hidden` event when modal hidden`', () => { + findGlobalSearchModal().vm.$emit('hidden'); + expect(wrapper.emitted('hidden')).toHaveLength(1); + }); + }); }); }); |