diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) | |
download | gitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js')
-rw-r--r-- | spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js b/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js index d306f7834f0..37416dcd4e7 100644 --- a/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js +++ b/spec/frontend/packages_and_registries/package_registry/components/details/package_title_spec.js @@ -22,16 +22,21 @@ const packageWithTags = { packageFiles: { nodes: packageFiles() }, }; +const defaultProvide = { + isGroupPage: false, +}; + describe('PackageTitle', () => { let wrapper; - async function createComponent(packageEntity = packageWithTags) { + async function createComponent(packageEntity = packageWithTags, provide = defaultProvide) { wrapper = shallowMountExtended(PackageTitle, { propsData: { packageEntity }, stubs: { TitleArea, GlSprintf, }, + provide, directives: { GlResizeObserver: createMockDirective(), }, @@ -199,11 +204,22 @@ describe('PackageTitle', () => { expect(findPipelineProject().exists()).toBe(false); }); - it('correctly shows the pipeline project if there is one', async () => { + it('does not display the pipeline project on project page even if it exists', async () => { await createComponent({ ...packageData(), pipelines: { nodes: packagePipelines() }, }); + expect(findPipelineProject().exists()).toBe(false); + }); + + it('correctly shows the pipeline project on group page if there is one', async () => { + await createComponent( + { + ...packageData(), + pipelines: { nodes: packagePipelines() }, + }, + { isGroupPage: true }, + ); expect(findPipelineProject().props()).toMatchObject({ text: packagePipelines()[0].project.name, icon: 'review-list', |