diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/frontend/projects/pipelines/charts | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) | |
download | gitlab-ce-311b0269b4eb9839fa63f80c8d7a58f32b8138a0.tar.gz |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/frontend/projects/pipelines/charts')
-rw-r--r-- | spec/frontend/projects/pipelines/charts/components/app_spec.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/frontend/projects/pipelines/charts/components/app_spec.js b/spec/frontend/projects/pipelines/charts/components/app_spec.js index 987a215eb4c..b4067f6a72b 100644 --- a/spec/frontend/projects/pipelines/charts/components/app_spec.js +++ b/spec/frontend/projects/pipelines/charts/components/app_spec.js @@ -11,6 +11,7 @@ jest.mock('~/lib/utils/url_utility'); const DeploymentFrequencyChartsStub = { name: 'DeploymentFrequencyCharts', render: () => {} }; const LeadTimeChartsStub = { name: 'LeadTimeCharts', render: () => {} }; +const ProjectQualitySummaryStub = { name: 'ProjectQualitySummary', render: () => {} }; describe('ProjectsPipelinesChartsApp', () => { let wrapper; @@ -23,10 +24,12 @@ describe('ProjectsPipelinesChartsApp', () => { { provide: { shouldRenderDoraCharts: true, + shouldRenderQualitySummary: true, }, stubs: { DeploymentFrequencyCharts: DeploymentFrequencyChartsStub, LeadTimeCharts: LeadTimeChartsStub, + ProjectQualitySummary: ProjectQualitySummaryStub, }, }, mountOptions, @@ -44,6 +47,7 @@ describe('ProjectsPipelinesChartsApp', () => { const findLeadTimeCharts = () => wrapper.find(LeadTimeChartsStub); const findDeploymentFrequencyCharts = () => wrapper.find(DeploymentFrequencyChartsStub); const findPipelineCharts = () => wrapper.find(PipelineCharts); + const findProjectQualitySummary = () => wrapper.find(ProjectQualitySummaryStub); describe('when all charts are available', () => { beforeEach(() => { @@ -70,6 +74,10 @@ describe('ProjectsPipelinesChartsApp', () => { expect(findLeadTimeCharts().exists()).toBe(true); }); + it('renders the project quality summary', () => { + expect(findProjectQualitySummary().exists()).toBe(true); + }); + it('sets the tab and url when a tab is clicked', async () => { let chartsPath; setWindowLocation(`${TEST_HOST}/gitlab-org/gitlab-test/-/pipelines/charts`); @@ -163,9 +171,11 @@ describe('ProjectsPipelinesChartsApp', () => { }); }); - describe('when the dora charts are not available', () => { + describe('when the dora charts are not available and project quality summary is not available', () => { beforeEach(() => { - createComponent({ provide: { shouldRenderDoraCharts: false } }); + createComponent({ + provide: { shouldRenderDoraCharts: false, shouldRenderQualitySummary: false }, + }); }); it('does not render tabs', () => { @@ -176,4 +186,14 @@ describe('ProjectsPipelinesChartsApp', () => { expect(findPipelineCharts().exists()).toBe(true); }); }); + + describe('when the project quality summary is not available', () => { + beforeEach(() => { + createComponent({ provide: { shouldRenderQualitySummary: false } }); + }); + + it('does not render the tab', () => { + expect(findProjectQualitySummary().exists()).toBe(false); + }); + }); }); |