diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-02 06:07:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-02 06:07:46 +0300 |
commit | 34beb8cec33a0ea1a296ecc9d1e5025d61624bcd (patch) | |
tree | 3633afa6fead0e18c927101a60e6176c2ced5fa4 /spec/frontend/ci | |
parent | 3ae3a2c23f5347493fc2842421941d56cb9545d6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci')
-rw-r--r-- | spec/frontend/ci/artifacts/utils_spec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/frontend/ci/artifacts/utils_spec.js b/spec/frontend/ci/artifacts/utils_spec.js new file mode 100644 index 00000000000..17b4a9f162b --- /dev/null +++ b/spec/frontend/ci/artifacts/utils_spec.js @@ -0,0 +1,16 @@ +import getJobArtifactsResponse from 'test_fixtures/graphql/ci/artifacts/graphql/queries/get_job_artifacts.query.graphql.json'; +import { numberToHumanSize } from '~/lib/utils/number_utils'; +import { totalArtifactsSizeForJob } from '~/ci/artifacts/utils'; + +const job = getJobArtifactsResponse.data.project.jobs.nodes[0]; +const artifacts = job.artifacts.nodes; + +describe('totalArtifactsSizeForJob', () => { + it('adds artifact sizes together', () => { + expect(totalArtifactsSizeForJob(job)).toBe( + numberToHumanSize( + Number(artifacts[0].size) + Number(artifacts[1].size) + Number(artifacts[2].size), + ), + ); + }); +}); |