diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-08 00:13:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-08 00:13:36 +0300 |
commit | c19944d9970b788d8523cee6ee05217a8afd7646 (patch) | |
tree | e2d15e8c0d541b9b2fe26b9b82f23661df120f94 /spec/frontend/projects | |
parent | 3ff3d897d6529aabb21aa6aed54eb430a9cf0fe2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/projects')
-rw-r--r-- | spec/frontend/projects/new/components/app_spec.js | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/spec/frontend/projects/new/components/app_spec.js b/spec/frontend/projects/new/components/app_spec.js index f6edbab3cca..42ef7837fa6 100644 --- a/spec/frontend/projects/new/components/app_spec.js +++ b/spec/frontend/projects/new/components/app_spec.js @@ -6,9 +6,13 @@ describe('Experimental new project creation app', () => { let wrapper; const createComponent = (propsData) => { - wrapper = shallowMount(App, { propsData }); + wrapper = shallowMount(App, { + propsData: { projectsUrl: '/dashboard/projects', ...propsData }, + }); }; + const findNewNamespacePage = () => wrapper.findComponent(NewNamespacePage); + afterEach(() => { wrapper.destroy(); }); @@ -34,11 +38,28 @@ describe('Experimental new project creation app', () => { expect( Boolean( - wrapper - .findComponent(NewNamespacePage) + findNewNamespacePage() .props() .panels.find((p) => p.name === 'cicd_for_external_repo'), ), ).toBe(isCiCdAvailable); }); + + it('creates correct breadcrumbs for top-level projects', () => { + createComponent(); + + expect(findNewNamespacePage().props('initialBreadcrumbs')).toEqual([ + { href: '/dashboard/projects', text: 'Projects' }, + { href: '#', text: 'New project' }, + ]); + }); + + it('creates correct breadcrumbs for projects within groups', () => { + createComponent({ parentGroupUrl: '/parent-group', parentGroupName: 'Parent Group' }); + + expect(findNewNamespacePage().props('initialBreadcrumbs')).toEqual([ + { href: '/parent-group', text: 'Parent Group' }, + { href: '#', text: 'New project' }, + ]); + }); }); |