diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-12 15:08:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-12 15:08:35 +0300 |
commit | 8ef107c43390ea9c9932afb55d1318e4716fbf3b (patch) | |
tree | ad35474f833e8da50107d8ca1e348f9a953c8d7c /spec/frontend/vue_shared | |
parent | e0df184fb182633972212cd62d6e3dc6e4bd0e62 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared')
-rw-r--r-- | spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js b/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js index b87ae8a232f..1ee6f2cfff3 100644 --- a/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js +++ b/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js @@ -4,6 +4,7 @@ import { nextTick } from 'vue'; import LegacyContainer from '~/vue_shared/new_namespace/components/legacy_container.vue'; import WelcomePage from '~/vue_shared/new_namespace/components/welcome.vue'; import NewNamespacePage from '~/vue_shared/new_namespace/new_namespace_page.vue'; +import NewTopLevelGroupAlert from '~/groups/components/new_top_level_group_alert.vue'; import SuperSidebarToggle from '~/super_sidebar/components/super_sidebar_toggle.vue'; import { sidebarState } from '~/super_sidebar/constants'; @@ -14,6 +15,7 @@ describe('Experimental new namespace creation app', () => { const findWelcomePage = () => wrapper.findComponent(WelcomePage); const findLegacyContainer = () => wrapper.findComponent(LegacyContainer); const findBreadcrumb = () => wrapper.findComponent(GlBreadcrumb); + const findNewTopLevelGroupAlert = () => wrapper.findComponent(NewTopLevelGroupAlert); const findSuperSidebarToggle = () => wrapper.findComponent(SuperSidebarToggle); const DEFAULT_PROPS = { @@ -33,6 +35,9 @@ describe('Experimental new namespace creation app', () => { ...DEFAULT_PROPS, ...propsData, }, + stubs: { + NewTopLevelGroupAlert, + }, }); }; @@ -125,4 +130,39 @@ describe('Experimental new namespace creation app', () => { expect(findSuperSidebarToggle().exists()).toBe(isToggleVisible); }); }); + + describe('top level group alert', () => { + beforeEach(() => { + window.location.hash = `#${DEFAULT_PROPS.panels[0].name}`; + }); + + describe('when self-managed', () => { + it('does not render alert', () => { + createComponent(); + + expect(findNewTopLevelGroupAlert().exists()).toBe(false); + }); + }); + + describe('when on .com', () => { + it('does not render alert', () => { + createComponent({ propsData: { isSaas: true } }); + + expect(findNewTopLevelGroupAlert().exists()).toBe(false); + }); + + describe('when empty parent group name', () => { + it('renders alert', () => { + createComponent({ + propsData: { + isSaas: true, + panels: [{ ...DEFAULT_PROPS.panels[0], detailProps: { parentGroupName: '' } }], + }, + }); + + expect(findNewTopLevelGroupAlert().exists()).toBe(true); + }); + }); + }); + }); }); |