summaryrefslogtreecommitdiff
path: root/spec/frontend/nav
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/nav')
-rw-r--r--spec/frontend/nav/components/new_nav_toggle_spec.js5
-rw-r--r--spec/frontend/nav/components/top_nav_app_spec.js2
-rw-r--r--spec/frontend/nav/components/top_nav_container_view_spec.js1
-rw-r--r--spec/frontend/nav/components/top_nav_dropdown_menu_spec.js1
-rw-r--r--spec/frontend/nav/components/top_nav_menu_sections_spec.js23
5 files changed, 26 insertions, 6 deletions
diff --git a/spec/frontend/nav/components/new_nav_toggle_spec.js b/spec/frontend/nav/components/new_nav_toggle_spec.js
index ee75dfb70e4..bad24345f9d 100644
--- a/spec/frontend/nav/components/new_nav_toggle_spec.js
+++ b/spec/frontend/nav/components/new_nav_toggle_spec.js
@@ -3,6 +3,7 @@ import MockAdapter from 'axios-mock-adapter';
import { getByText as getByTextHelper } from '@testing-library/dom';
import { GlToggle } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils';
+import { HTTP_STATUS_INTERNAL_SERVER_ERROR, HTTP_STATUS_OK } from '~/lib/utils/http_status';
import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
import NewNavToggle from '~/nav/components/new_nav_toggle.vue';
import waitForPromises from 'helpers/wait_for_promises';
@@ -74,7 +75,7 @@ describe('NewNavToggle', () => {
});
it('reloads the page on success', async () => {
- mock.onPut(TEST_ENDPONT).reply(200);
+ mock.onPut(TEST_ENDPONT).reply(HTTP_STATUS_OK);
actFn();
await waitForPromises();
@@ -83,7 +84,7 @@ describe('NewNavToggle', () => {
});
it('shows an alert on error', async () => {
- mock.onPut(TEST_ENDPONT).reply(500);
+ mock.onPut(TEST_ENDPONT).reply(HTTP_STATUS_INTERNAL_SERVER_ERROR);
actFn();
await waitForPromises();
diff --git a/spec/frontend/nav/components/top_nav_app_spec.js b/spec/frontend/nav/components/top_nav_app_spec.js
index b32ab5ebe09..e70f70afc97 100644
--- a/spec/frontend/nav/components/top_nav_app_spec.js
+++ b/spec/frontend/nav/components/top_nav_app_spec.js
@@ -65,7 +65,7 @@ describe('~/nav/components/top_nav_app.vue', () => {
expect(trackingSpy).toHaveBeenCalledWith(undefined, 'click_nav', {
label: 'hamburger_menu',
- property: 'top_navigation',
+ property: 'navigation_top',
});
});
});
diff --git a/spec/frontend/nav/components/top_nav_container_view_spec.js b/spec/frontend/nav/components/top_nav_container_view_spec.js
index 0218f09af0a..293fe361fa9 100644
--- a/spec/frontend/nav/components/top_nav_container_view_spec.js
+++ b/spec/frontend/nav/components/top_nav_container_view_spec.js
@@ -103,6 +103,7 @@ describe('~/nav/components/top_nav_container_view.vue', () => {
expect(findMenuSections().props()).toEqual({
sections,
withTopBorder: true,
+ isPrimarySection: false,
});
});
});
diff --git a/spec/frontend/nav/components/top_nav_dropdown_menu_spec.js b/spec/frontend/nav/components/top_nav_dropdown_menu_spec.js
index 048fca846ad..8a0340087ec 100644
--- a/spec/frontend/nav/components/top_nav_dropdown_menu_spec.js
+++ b/spec/frontend/nav/components/top_nav_dropdown_menu_spec.js
@@ -56,6 +56,7 @@ describe('~/nav/components/top_nav_dropdown_menu.vue', () => {
{ id: 'secondary', menuItems: TEST_NAV_DATA.secondary },
],
withTopBorder: false,
+ isPrimarySection: true,
});
});
diff --git a/spec/frontend/nav/components/top_nav_menu_sections_spec.js b/spec/frontend/nav/components/top_nav_menu_sections_spec.js
index 0ed5cffd93f..7a5a8475ab7 100644
--- a/spec/frontend/nav/components/top_nav_menu_sections_spec.js
+++ b/spec/frontend/nav/components/top_nav_menu_sections_spec.js
@@ -80,7 +80,11 @@ describe('~/nav/components/top_nav_menu_sections.vue', () => {
}),
},
{
- classes: [...TopNavMenuSections.BORDER_CLASSES.split(' '), 'gl-mt-3'],
+ classes: [
+ ...TopNavMenuSections.BORDER_CLASSES.split(' '),
+ 'gl-border-gray-50',
+ 'gl-mt-3',
+ ],
menuItems: TEST_SECTIONS[1].menuItems.map((menuItem, index) => {
const classes = menuItem.type === 'header' ? [...headerClasses] : [...itemClasses];
if (index > 0) classes.push(menuItem.type === 'header' ? 'gl-pt-3!' : 'gl-mt-1');
@@ -117,8 +121,21 @@ describe('~/nav/components/top_nav_menu_sections.vue', () => {
it('renders border classes for top section', () => {
expect(findSectionModels().map((x) => x.classes)).toEqual([
- [...TopNavMenuSections.BORDER_CLASSES.split(' ')],
- [...TopNavMenuSections.BORDER_CLASSES.split(' '), 'gl-mt-3'],
+ [...TopNavMenuSections.BORDER_CLASSES.split(' '), 'gl-border-gray-50'],
+ [...TopNavMenuSections.BORDER_CLASSES.split(' '), 'gl-border-gray-50', 'gl-mt-3'],
+ ]);
+ });
+ });
+
+ describe('with isPrimarySection=true', () => {
+ beforeEach(() => {
+ createComponent({ isPrimarySection: true });
+ });
+
+ it('renders border classes for top section', () => {
+ expect(findSectionModels().map((x) => x.classes)).toEqual([
+ [],
+ [...TopNavMenuSections.BORDER_CLASSES.split(' '), 'gl-border-gray-100', 'gl-mt-3'],
]);
});
});