diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-09 15:09:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-09 15:09:48 +0300 |
commit | 3c53fbc50bf8d084f1184836468850d2a83ef920 (patch) | |
tree | 85c451a4082e7b5e8dc3ecb6265edb1aef0b14f0 /spec/frontend/search/topbar/components/app_spec.js | |
parent | e7462f7b49a60b2ee7be14682c23190f7f7c5ba7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/search/topbar/components/app_spec.js')
-rw-r--r-- | spec/frontend/search/topbar/components/app_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/search/topbar/components/app_spec.js b/spec/frontend/search/topbar/components/app_spec.js index faf3629b444..ff37c733fdb 100644 --- a/spec/frontend/search/topbar/components/app_spec.js +++ b/spec/frontend/search/topbar/components/app_spec.js @@ -5,6 +5,7 @@ import { MOCK_QUERY } from 'jest/search/mock_data'; import GlobalSearchTopbar from '~/search/topbar/components/app.vue'; import GroupFilter from '~/search/topbar/components/group_filter.vue'; import ProjectFilter from '~/search/topbar/components/project_filter.vue'; +import ScopeTabs from '~/search/topbar/components/scope_tabs.vue'; const localVue = createLocalVue(); localVue.use(Vuex); @@ -42,6 +43,7 @@ describe('GlobalSearchTopbar', () => { const findGroupFilter = () => wrapper.find(GroupFilter); const findProjectFilter = () => wrapper.find(ProjectFilter); const findSearchButton = () => wrapper.find(GlButton); + const findScopeTabs = () => wrapper.find(ScopeTabs); describe('template', () => { beforeEach(() => { @@ -52,6 +54,18 @@ describe('GlobalSearchTopbar', () => { expect(findTopbarForm().exists()).toBe(true); }); + describe('Scope Tabs', () => { + it('renders when search param is set', () => { + createComponent({ query: { search: 'test' } }); + expect(findScopeTabs().exists()).toBe(true); + }); + it('does not render search param is blank', () => { + createComponent({ query: {} }); + + expect(findScopeTabs().exists()).toBe(false); + }); + }); + describe('Search box', () => { it('renders always', () => { expect(findGlSearchBox().exists()).toBe(true); |