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`} label={t`Started`}
value={formatDateString(job.started)} value={formatDateString(job.started)}
/> />
<Detail {job?.finished && (
dataCy="job-finished-date" <Detail
label={t`Finished`} dataCy="job-finished-date"
value={formatDateString(job.finished)} label={t`Finished`}
/> value={formatDateString(job.finished)}
/>
)}
{jobTemplate && ( {jobTemplate && (
<Detail <Detail
dataCy="job-template" dataCy="job-template"

View File

@@ -111,6 +111,18 @@ describe('<JobDetail />', () => {
).toHaveLength(1); ).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', () => { test('should display module name and module arguments', () => {
wrapper = mountWithContexts( wrapper = mountWithContexts(
<JobDetail <JobDetail