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:
Diffstat (limited to 'spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js')
-rw-r--r--spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js b/spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js
index d85942b9634..44c243d15f7 100644
--- a/spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js
+++ b/spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js
@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils';
import Vue, { nextTick } from 'vue';
// eslint-disable-next-line no-restricted-imports
import Vuex from 'vuex';
+import sidebarEventHub from '~/super_sidebar/event_hub';
import ScopeSidebarNavigation from '~/search/sidebar/components/scope_sidebar_navigation.vue';
import NavItem from '~/super_sidebar/components/nav_item.vue';
import { MOCK_QUERY, MOCK_NAVIGATION, MOCK_NAVIGATION_ITEMS } from '../../mock_data';
@@ -49,6 +50,7 @@ describe('ScopeSidebarNavigation', () => {
describe('scope navigation', () => {
beforeEach(() => {
+ jest.spyOn(sidebarEventHub, '$emit');
createComponent({ urlQuery: { ...MOCK_QUERY, search: 'test' } });
});
@@ -71,6 +73,11 @@ describe('ScopeSidebarNavigation', () => {
expect(findNavItems().at(linkAtPosition).findComponent('a').attributes('href')).toBe(link);
});
+
+ it('always emits toggle-menu-header event', () => {
+ expect(sidebarEventHub.$emit).toHaveBeenCalledWith('toggle-menu-header', false);
+ expect(sidebarEventHub.$emit).toHaveBeenCalledTimes(1);
+ });
});
describe('scope navigation sets proper state with url scope set', () => {