Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-08 21:11:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-08 21:11:09 +0300
commitda576e4a0b8e1adc3df559a163b01c962a565ef5 (patch)
treef563a8746fd54a2d638f6b421955220af24c8489 /spec/frontend/search/sidebar
parentb5bdf6e5219b3b57107aee49ba7c103affb65dd9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/search/sidebar')
-rw-r--r--spec/frontend/search/sidebar/components/app_spec.js27
1 files changed, 26 insertions, 1 deletions
diff --git a/spec/frontend/search/sidebar/components/app_spec.js b/spec/frontend/search/sidebar/components/app_spec.js
index b4e3388f067..e87217950cd 100644
--- a/spec/frontend/search/sidebar/components/app_spec.js
+++ b/spec/frontend/search/sidebar/components/app_spec.js
@@ -4,6 +4,7 @@ import Vuex from 'vuex';
import { MOCK_QUERY } from 'jest/search/mock_data';
import GlobalSearchSidebar from '~/search/sidebar/components/app.vue';
import ResultsFilters from '~/search/sidebar/components/results_filters.vue';
+import ScopeNavigation from '~/search/sidebar/components/scope_navigation.vue';
Vue.use(Vuex);
@@ -15,7 +16,7 @@ describe('GlobalSearchSidebar', () => {
resetQuery: jest.fn(),
};
- const createComponent = (initialState) => {
+ const createComponent = (initialState, featureFlags) => {
const store = new Vuex.Store({
state: {
urlQuery: MOCK_QUERY,
@@ -26,6 +27,11 @@ describe('GlobalSearchSidebar', () => {
wrapper = shallowMount(GlobalSearchSidebar, {
store,
+ provide: {
+ glFeatures: {
+ ...featureFlags,
+ },
+ },
});
};
@@ -35,6 +41,7 @@ describe('GlobalSearchSidebar', () => {
const findSidebarSection = () => wrapper.find('section');
const findFilters = () => wrapper.findComponent(ResultsFilters);
+ const findSidebarNavigation = () => wrapper.findComponent(ScopeNavigation);
describe('renders properly', () => {
describe('scope=projects', () => {
@@ -78,4 +85,22 @@ describe('GlobalSearchSidebar', () => {
});
});
});
+
+ describe('when search_page_vertical_nav is enabled', () => {
+ beforeEach(() => {
+ createComponent({}, { searchPageVerticalNav: true });
+ });
+ it('shows the vertical navigation', () => {
+ expect(findSidebarNavigation().exists()).toBe(true);
+ });
+ });
+
+ describe('when search_page_vertical_nav is disabled', () => {
+ beforeEach(() => {
+ createComponent({}, { searchPageVerticalNav: false });
+ });
+ it('hides the vertical navigation', () => {
+ expect(findSidebarNavigation().exists()).toBe(false);
+ });
+ });
});