Display finished date once the job is finished

Display finished date once the job is finished.

See: https://github.com/ansible/awx/issues/10977
This commit is contained in:
nixocio 2021-09-02 13:22:59 -04:00
parent 9ee9de76b5
commit fb5394e31c
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