diff --git a/awx/ui/src/components/JobList/JobListItem.js b/awx/ui/src/components/JobList/JobListItem.js index 10a63d5c88..8dbbc0b911 100644 --- a/awx/ui/src/components/JobList/JobListItem.js +++ b/awx/ui/src/components/JobList/JobListItem.js @@ -222,13 +222,15 @@ function JobListItem({ dataCy={`job-${job.id}-project`} /> )} - {job.type !== 'workflow_job' && !isJobRunning(job.status) && ( - - )} + {job.type !== 'workflow_job' && + !isJobRunning(job.status) && + job.status !== 'canceled' && ( + + )} {credentials && credentials.length > 0 && ( ', () => { @@ -61,7 +62,7 @@ describe('', () => { expect(wrapper.find('LaunchButton').length).toBe(1); }); - test('should render souce data in expanded view', () => { + test('should render source data in expanded view', () => { wrapper = mountWithContexts( @@ -127,6 +128,49 @@ describe('', () => { ); expect(wrapper.find('Td[dataLabel="Type"]').length).toBe(1); }); + + test('should not display EE for canceled jobs', () => { + wrapper = mountWithContexts( +
+ + {}} + /> + +
+ ); + expect(wrapper.find('Detail[label="Execution Environment"]').length).toBe( + 0 + ); + }); + + test('should display missing resource for completed jobs and missing EE', () => { + wrapper = mountWithContexts( + + + {}} + /> + +
+ ); + expect(wrapper.find('Detail[label="Execution Environment"]').length).toBe( + 1 + ); + expect( + wrapper.find('Detail[label="Execution Environment"] dd').text() + ).toBe('Missing resource'); + }); }); describe('', () => {