Merge pull request #11013 from nixocio/ui_issue_10977

Display finished date once the job is finished
This commit is contained in:
Alex Corey 2021-09-02 16:44:15 -04:00 committed by GitHub
commit 324ca7fe72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

View File

@ -139,11 +139,13 @@ function JobDetail({ job, inventorySourceLabels }) {
label={t`Started`}
value={formatDateString(job.started)}
/>
<Detail
dataCy="job-finished-date"
label={t`Finished`}
value={formatDateString(job.finished)}
/>
{job?.finished && (
<Detail
dataCy="job-finished-date"
label={t`Finished`}
value={formatDateString(job.finished)}
/>
)}
{jobTemplate && (
<Detail
dataCy="job-template"

View File

@ -111,6 +111,18 @@ describe('<JobDetail />', () => {
).toHaveLength(1);
});
test('should not display finished date', () => {
wrapper = mountWithContexts(
<JobDetail
job={{
...mockJobData,
finished: null,
}}
/>
);
expect(wrapper.find(`Detail[label="Finished"]`).length).toBe(0);
});
test('should display module name and module arguments', () => {
wrapper = mountWithContexts(
<JobDetail