diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-28 18:09:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-28 18:09:19 +0300 |
commit | 24623a974348595d33cc9be6881b285a026ff13b (patch) | |
tree | 20a28aa9b423a65c52ea5ca54c6fcb91dd9ddfd6 /spec/frontend/search/sidebar | |
parent | 72ba138510cad0a8c4819ef0512153dd4dbced7f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/search/sidebar')
-rw-r--r-- | spec/frontend/search/sidebar/components/scope_legacy_navigation_spec.js | 6 | ||||
-rw-r--r-- | spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/spec/frontend/search/sidebar/components/scope_legacy_navigation_spec.js b/spec/frontend/search/sidebar/components/scope_legacy_navigation_spec.js index 6a94da31a1b..786ad806ea6 100644 --- a/spec/frontend/search/sidebar/components/scope_legacy_navigation_spec.js +++ b/spec/frontend/search/sidebar/components/scope_legacy_navigation_spec.js @@ -7,6 +7,8 @@ import ScopeLegacyNavigation from '~/search/sidebar/components/scope_legacy_navi Vue.use(Vuex); +const MOCK_NAVIGATION_ENTRIES = Object.entries(MOCK_NAVIGATION); + describe('ScopeLegacyNavigation', () => { let wrapper; @@ -55,12 +57,12 @@ describe('ScopeLegacyNavigation', () => { }); it('renders all nav item components', () => { - expect(findGlNavItems()).toHaveLength(9); + expect(findGlNavItems()).toHaveLength(MOCK_NAVIGATION_ENTRIES.length); }); it('has all proper links', () => { const linkAtPosition = 3; - const { link } = MOCK_NAVIGATION[Object.keys(MOCK_NAVIGATION)[linkAtPosition]]; + const { link } = MOCK_NAVIGATION_ENTRIES[linkAtPosition][1]; expect(findGlNavItems().at(linkAtPosition).attributes('href')).toBe(link); }); 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 4b71ff0bedc..86939bdc5d6 100644 --- a/spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js +++ b/spec/frontend/search/sidebar/components/scope_sidebar_navigation_spec.js @@ -7,6 +7,8 @@ import { MOCK_QUERY, MOCK_NAVIGATION, MOCK_NAVIGATION_ITEMS } from '../../mock_d Vue.use(Vuex); +const MOCK_NAVIGATION_ENTRIES = Object.entries(MOCK_NAVIGATION); + describe('ScopeSidebarNavigation', () => { let wrapper; @@ -59,7 +61,7 @@ describe('ScopeSidebarNavigation', () => { }); it('renders all nav item components', () => { - expect(findNavItems()).toHaveLength(9); + expect(findNavItems()).toHaveLength(MOCK_NAVIGATION_ENTRIES.length); }); it('has all proper links', () => { |