diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-13 00:13:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-13 00:13:31 +0300 |
commit | 42a4fe5b394e010b3f512a5a138359618295193b (patch) | |
tree | 9552d72a17537c74f813d489e822e09e91d1dc3c /spec/frontend | |
parent | 6121ad5af38294f12db08f13aec122c3dbef583a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js b/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js index d44886a4f95..36f27d1781e 100644 --- a/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js +++ b/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js @@ -22,11 +22,12 @@ import { I18N_FETCH_ERROR, INITIAL_CURRENT_PAGE, I18N_BULK_DELETE_ERROR, - SELECTED_ARTIFACTS_MAX_COUNT, } from '~/ci/artifacts/constants'; import { totalArtifactsSizeForJob } from '~/ci/artifacts/utils'; import { createAlert } from '~/alert'; +const jobArtifactsCountLimit = 100; + jest.mock('~/alert'); Vue.use(VueApollo); @@ -127,10 +128,10 @@ describe('JobArtifactsTable component', () => { .map((jobNode) => jobNode.artifacts.nodes.map((artifactNode) => artifactNode.id)) .reduce((artifacts, jobArtifacts) => artifacts.concat(jobArtifacts)); - const maxSelectedArtifacts = new Array(SELECTED_ARTIFACTS_MAX_COUNT).fill('artifact-id'); + const maxSelectedArtifacts = new Array(jobArtifactsCountLimit).fill('artifact-id'); const maxSelectedArtifactsIncludingCurrentPage = [ ...allArtifacts, - ...new Array(SELECTED_ARTIFACTS_MAX_COUNT - allArtifacts.length).fill('artifact-id'), + ...new Array(jobArtifactsCountLimit - allArtifacts.length).fill('artifact-id'), ]; const createComponent = ({ @@ -151,6 +152,7 @@ describe('JobArtifactsTable component', () => { projectPath: 'project/path', projectId, canDestroyArtifacts, + jobArtifactsCountLimit, }, mocks: { $toast: { @@ -665,7 +667,7 @@ describe('JobArtifactsTable component', () => { describe('select all checkbox respects selected artifacts limit', () => { describe('when selecting all visible artifacts would exceed the limit', () => { - const selectedArtifactsLength = SELECTED_ARTIFACTS_MAX_COUNT - 1; + const selectedArtifactsLength = jobArtifactsCountLimit - 1; beforeEach(async () => { createComponent({ @@ -687,9 +689,7 @@ describe('JobArtifactsTable component', () => { await nextTick(); expect(findSelectAllCheckboxChecked()).toBe(true); - expect(findBulkDelete().props('selectedArtifacts')).toHaveLength( - SELECTED_ARTIFACTS_MAX_COUNT, - ); + expect(findBulkDelete().props('selectedArtifacts')).toHaveLength(jobArtifactsCountLimit); expect(findBulkDelete().props('selectedArtifacts')).not.toContain( allArtifacts[allArtifacts.length - 1], ); @@ -748,7 +748,7 @@ describe('JobArtifactsTable component', () => { it('deselects all artifacts when toggled', async () => { expect(findBulkDelete().props('selectedArtifacts')).toHaveLength( - SELECTED_ARTIFACTS_MAX_COUNT, + jobArtifactsCountLimit, ); toggleSelectAllCheckbox(); @@ -757,7 +757,7 @@ describe('JobArtifactsTable component', () => { expect(findSelectAllCheckboxChecked()).toBe(false); expect(findBulkDelete().props('selectedArtifacts')).toHaveLength( - SELECTED_ARTIFACTS_MAX_COUNT - allArtifacts.length, + jobArtifactsCountLimit - allArtifacts.length, ); }); }); |