diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
commit | db384e6b19af03b4c3c82a5760d83a3fd79f7982 (patch) | |
tree | 34beaef37df5f47ccbcf5729d7583aae093cffa0 /spec/frontend/super_sidebar/components/context_switcher_spec.js | |
parent | 54fd7b1bad233e3944434da91d257fa7f63c3996 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-eev16.3.0-rc42
Diffstat (limited to 'spec/frontend/super_sidebar/components/context_switcher_spec.js')
-rw-r--r-- | spec/frontend/super_sidebar/components/context_switcher_spec.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/spec/frontend/super_sidebar/components/context_switcher_spec.js b/spec/frontend/super_sidebar/components/context_switcher_spec.js index 4317f451377..dd8f39e7cb7 100644 --- a/spec/frontend/super_sidebar/components/context_switcher_spec.js +++ b/spec/frontend/super_sidebar/components/context_switcher_spec.js @@ -15,7 +15,7 @@ import { trackContextAccess, formatContextSwitcherItems } from '~/super_sidebar/ import { DEFAULT_DEBOUNCE_AND_THROTTLE_MS } from '~/lib/utils/constants'; import waitForPromises from 'helpers/wait_for_promises'; import { stubComponent } from 'helpers/stub_component'; -import { searchUserProjectsAndGroupsResponseMock } from '../mock_data'; +import { contextSwitcherLinks, searchUserProjectsAndGroupsResponseMock } from '../mock_data'; jest.mock('~/super_sidebar/utils', () => ({ getStorageKeyFor: jest.requireActual('~/super_sidebar/utils').getStorageKeyFor, @@ -26,9 +26,6 @@ jest.mock('~/super_sidebar/utils', () => ({ })); const focusInputMock = jest.fn(); -const persistentLinks = [ - { title: 'Explore', link: '/explore', icon: 'compass', link_classes: 'persistent-link-class' }, -]; const username = 'root'; const projectsPath = 'projectsPath'; const groupsPath = 'groupsPath'; @@ -71,8 +68,10 @@ describe('ContextSwitcher component', () => { wrapper = shallowMountExtended(ContextSwitcher, { apolloProvider: mockApollo, + provide: { + contextSwitcherLinks, + }, propsData: { - persistentLinks, username, projectsPath, groupsPath, @@ -107,14 +106,14 @@ describe('ContextSwitcher component', () => { createWrapper(); }); - it('renders the persistent links', () => { + it('renders the context switcher links', () => { const navItems = findNavItems(); const firstNavItem = navItems.at(0); - expect(navItems.length).toBe(persistentLinks.length); - expect(firstNavItem.props('item')).toBe(persistentLinks[0]); + expect(navItems.length).toBe(contextSwitcherLinks.length); + expect(firstNavItem.props('item')).toBe(contextSwitcherLinks[0]); expect(firstNavItem.props('linkClasses')).toEqual({ - [persistentLinks[0].link_classes]: persistentLinks[0].link_classes, + [contextSwitcherLinks[0].link_classes]: contextSwitcherLinks[0].link_classes, }); }); |