mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
Merge pull request #11134 from nixocio/ui_issue_11127
Do not display EE if a job was canceled
This commit is contained in:
commit
7b6befa3d2
@ -222,13 +222,15 @@ function JobListItem({
|
||||
dataCy={`job-${job.id}-project`}
|
||||
/>
|
||||
)}
|
||||
{job.type !== 'workflow_job' && !isJobRunning(job.status) && (
|
||||
<ExecutionEnvironmentDetail
|
||||
executionEnvironment={execution_environment}
|
||||
verifyMissingVirtualEnv={false}
|
||||
dataCy={`execution-environment-detail-${job.id}`}
|
||||
/>
|
||||
)}
|
||||
{job.type !== 'workflow_job' &&
|
||||
!isJobRunning(job.status) &&
|
||||
job.status !== 'canceled' && (
|
||||
<ExecutionEnvironmentDetail
|
||||
executionEnvironment={execution_environment}
|
||||
verifyMissingVirtualEnv={false}
|
||||
dataCy={`execution-environment-detail-${job.id}`}
|
||||
/>
|
||||
)}
|
||||
{credentials && credentials.length > 0 && (
|
||||
<Detail
|
||||
fullWidth
|
||||
|
||||
@ -24,6 +24,7 @@ const mockJob = {
|
||||
status: 'successful',
|
||||
job_slice_number: 1,
|
||||
job_slice_count: 3,
|
||||
execution_environment: 1,
|
||||
};
|
||||
|
||||
describe('<JobListItem />', () => {
|
||||
@ -61,7 +62,7 @@ describe('<JobListItem />', () => {
|
||||
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(
|
||||
<table>
|
||||
<tbody>
|
||||
@ -127,6 +128,49 @@ describe('<JobListItem />', () => {
|
||||
);
|
||||
expect(wrapper.find('Td[dataLabel="Type"]').length).toBe(1);
|
||||
});
|
||||
|
||||
test('should not display EE for canceled jobs', () => {
|
||||
wrapper = mountWithContexts(
|
||||
<table>
|
||||
<tbody>
|
||||
<JobListItem
|
||||
job={{
|
||||
...mockJob,
|
||||
status: 'canceled',
|
||||
execution_environment: null,
|
||||
}}
|
||||
showTypeColumn
|
||||
isSelected
|
||||
onSelect={() => {}}
|
||||
/>
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(wrapper.find('Detail[label="Execution Environment"]').length).toBe(
|
||||
0
|
||||
);
|
||||
});
|
||||
|
||||
test('should display missing resource for completed jobs and missing EE', () => {
|
||||
wrapper = mountWithContexts(
|
||||
<table>
|
||||
<tbody>
|
||||
<JobListItem
|
||||
job={mockJob}
|
||||
showTypeColumn
|
||||
isSelected
|
||||
onSelect={() => {}}
|
||||
/>
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(wrapper.find('Detail[label="Execution Environment"]').length).toBe(
|
||||
1
|
||||
);
|
||||
expect(
|
||||
wrapper.find('Detail[label="Execution Environment"] dd').text()
|
||||
).toBe('Missing resource');
|
||||
});
|
||||
});
|
||||
|
||||
describe('<JobListItem with failed job />', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user