diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 15:07:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 15:07:12 +0300 |
commit | 43771438e9ccf20d1b6cf12b690e63844d7c3d49 (patch) | |
tree | 147aefba22d99be62ff3c112f50e205e486e58c7 /spec/frontend/ml | |
parent | eeb25534bae1021f5b7940138ee56dea8fc79949 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ml')
-rw-r--r-- | spec/frontend/ml/experiment_tracking/routes/candidates/show/ml_candidates_show_spec.js | 35 | ||||
-rw-r--r-- | spec/frontend/ml/experiment_tracking/routes/candidates/show/mock_data.js | 12 |
2 files changed, 47 insertions, 0 deletions
diff --git a/spec/frontend/ml/experiment_tracking/routes/candidates/show/ml_candidates_show_spec.js b/spec/frontend/ml/experiment_tracking/routes/candidates/show/ml_candidates_show_spec.js index 9d1c22faa8f..07d501c4e44 100644 --- a/spec/frontend/ml/experiment_tracking/routes/candidates/show/ml_candidates_show_spec.js +++ b/spec/frontend/ml/experiment_tracking/routes/candidates/show/ml_candidates_show_spec.js @@ -48,6 +48,14 @@ describe('MlCandidatesShow', () => { ['', 'Status', CANDIDATE.info.status, ''], ['', 'Experiment', CANDIDATE.info.experiment_name, CANDIDATE.info.path_to_experiment], ['', 'Artifacts', 'Artifacts', CANDIDATE.info.path_to_artifact], + ['CI', 'Job', CANDIDATE.info.ci_job.name, CANDIDATE.info.ci_job.path], + ['', 'Triggered by', CANDIDATE.info.ci_job.user.username, CANDIDATE.info.ci_job.user.path], + [ + '', + 'Merge request', + CANDIDATE.info.ci_job.merge_request.title, + CANDIDATE.info.ci_job.merge_request.path, + ], ['Parameters', CANDIDATE.params[0].name, CANDIDATE.params[0].value, ''], ['', CANDIDATE.params[1].name, CANDIDATE.params[1].value, ''], ['Metrics', CANDIDATE.metrics[0].name, CANDIDATE.metrics[0].value, ''], @@ -75,6 +83,9 @@ describe('MlCandidatesShow', () => { expect(findSectionLabel('Parameters').exists()).toBe(true); expect(findSectionLabel('Metadata').exists()).toBe(true); expect(findSectionLabel('Metrics').exists()).toBe(true); + expect(findSectionLabel('CI').exists()).toBe(true); + expect(findLabel('Merge request').exists()).toBe(true); + expect(findLabel('Triggered by').exists()).toBe(true); }); }); @@ -99,6 +110,7 @@ describe('MlCandidatesShow', () => { delete candidate.params; delete candidate.metrics; delete candidate.metadata; + delete candidate.info.ci_job; return candidate; }), ); @@ -114,6 +126,29 @@ describe('MlCandidatesShow', () => { it('does not render metrics', () => { expect(findSectionLabel('Metrics').exists()).toBe(false); }); + + it('does not render CI info', () => { + expect(findSectionLabel('CI').exists()).toBe(false); + }); + }); + + describe('Has CI, but no user or mr', () => { + beforeEach(() => + createWrapper(() => { + const candidate = newCandidate(); + delete candidate.info.ci_job.user; + delete candidate.info.ci_job.merge_request; + return candidate; + }), + ); + + it('does not render MR info', () => { + expect(findLabel('Merge request').exists()).toBe(false); + }); + + it('does not render CI user info', () => { + expect(findLabel('Triggered by').exists()).toBe(false); + }); }); }); }); diff --git a/spec/frontend/ml/experiment_tracking/routes/candidates/show/mock_data.js b/spec/frontend/ml/experiment_tracking/routes/candidates/show/mock_data.js index cad2c03fc93..16c1b29f7bc 100644 --- a/spec/frontend/ml/experiment_tracking/routes/candidates/show/mock_data.js +++ b/spec/frontend/ml/experiment_tracking/routes/candidates/show/mock_data.js @@ -19,5 +19,17 @@ export const newCandidate = () => ({ path_to_experiment: 'path/to/experiment', status: 'SUCCESS', path: 'path_to_candidate', + ci_job: { + name: 'test', + path: 'path/to/job', + merge_request: { + path: 'path/to/mr', + title: 'Some MR', + }, + user: { + path: 'path/to/ci/user', + username: 'ciuser', + }, + }, }, }); |