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/nav/components/responsive_app_spec.js')
-rw-r--r--spec/frontend/nav/components/responsive_app_spec.js50
1 files changed, 0 insertions, 50 deletions
diff --git a/spec/frontend/nav/components/responsive_app_spec.js b/spec/frontend/nav/components/responsive_app_spec.js
index e1b443745e3..4af8c6020bc 100644
--- a/spec/frontend/nav/components/responsive_app_spec.js
+++ b/spec/frontend/nav/components/responsive_app_spec.js
@@ -3,16 +3,10 @@ import ResponsiveApp from '~/nav/components/responsive_app.vue';
import ResponsiveHeader from '~/nav/components/responsive_header.vue';
import ResponsiveHome from '~/nav/components/responsive_home.vue';
import TopNavContainerView from '~/nav/components/top_nav_container_view.vue';
-import eventHub, { EVENT_RESPONSIVE_TOGGLE } from '~/nav/event_hub';
import { resetMenuItemsActive } from '~/nav/utils/reset_menu_items_active';
import KeepAliveSlots from '~/vue_shared/components/keep_alive_slots.vue';
import { TEST_NAV_DATA } from '../mock_data';
-const HTML_HEADER_CONTENT = '<div class="header-content"></div>';
-const HTML_MENU_EXPANDED = '<div class="menu-expanded"></div>';
-const HTML_HEADER_WITH_MENU_EXPANDED =
- '<div></div><div class="header-content menu-expanded"></div>';
-
describe('~/nav/components/responsive_app.vue', () => {
let wrapper;
@@ -26,13 +20,10 @@ describe('~/nav/components/responsive_app.vue', () => {
},
});
};
- const triggerResponsiveToggle = () => eventHub.$emit(EVENT_RESPONSIVE_TOGGLE);
-
const findHome = () => wrapper.findComponent(ResponsiveHome);
const findMobileOverlay = () => wrapper.find('[data-testid="mobile-overlay"]');
const findSubviewHeader = () => wrapper.findComponent(ResponsiveHeader);
const findSubviewContainer = () => wrapper.findComponent(TopNavContainerView);
- const hasBodyResponsiveOpen = () => document.body.classList.contains('top-nav-responsive-open');
const hasMobileOverlayVisible = () => findMobileOverlay().classes('mobile-nav-open');
beforeEach(() => {
@@ -58,23 +49,6 @@ describe('~/nav/components/responsive_app.vue', () => {
});
it.each`
- bodyHtml | expectation
- ${''} | ${false}
- ${HTML_HEADER_CONTENT} | ${false}
- ${HTML_MENU_EXPANDED} | ${false}
- ${HTML_HEADER_WITH_MENU_EXPANDED} | ${true}
- `(
- 'with responsive toggle event and html set to $bodyHtml, responsive open = $expectation',
- ({ bodyHtml, expectation }) => {
- document.body.innerHTML = bodyHtml;
-
- triggerResponsiveToggle();
-
- expect(hasBodyResponsiveOpen()).toBe(expectation);
- },
- );
-
- it.each`
events | expectation
${[]} | ${false}
${['bv::dropdown::show']} | ${true}
@@ -96,17 +70,6 @@ describe('~/nav/components/responsive_app.vue', () => {
);
});
- describe('with menu expanded in body', () => {
- beforeEach(() => {
- document.body.innerHTML = HTML_HEADER_WITH_MENU_EXPANDED;
- createComponent();
- });
-
- it('sets the body responsive open', () => {
- expect(hasBodyResponsiveOpen()).toBe(true);
- });
- });
-
const projectsContainerProps = {
containerClass: 'gl-px-3',
frequentItemsDropdownType: ResponsiveApp.FREQUENT_ITEMS_PROJECTS.namespace,
@@ -159,17 +122,4 @@ describe('~/nav/components/responsive_app.vue', () => {
});
});
});
-
- describe('when destroyed', () => {
- beforeEach(() => {
- createComponent();
- wrapper.destroy();
- });
-
- it('responsive toggle event does nothing', () => {
- triggerResponsiveToggle();
-
- expect(hasBodyResponsiveOpen()).toBe(false);
- });
- });
});