mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Ensures no missingResourceIcon for WFJT on JTList
Adds a test to ensure that missingResourceIcon is not shown for WFJTs.
This commit is contained in:
parent
0a8fe4d812
commit
21890efca6
@ -63,9 +63,11 @@ class TemplateListItem extends Component {
|
||||
const { i18n, template, isSelected, onSelect } = this.props;
|
||||
const canLaunch = template.summary_fields.user_capabilities.start;
|
||||
const missingResourceIcon =
|
||||
(!template.summary_fields.inventory &&
|
||||
!template.ask_inventory_on_launch) ||
|
||||
!template.summary_fields.project;
|
||||
template.type === 'job_template' &&
|
||||
(!template.summary_fields.project ||
|
||||
(!template.summary_fields.inventory &&
|
||||
!template.ask_inventory_on_launch));
|
||||
|
||||
return (
|
||||
<DataListItem
|
||||
aria-labelledby={`check-action-${template.id}`}
|
||||
|
||||
@ -142,4 +142,23 @@ describe('<TemplatesListItem />', () => {
|
||||
);
|
||||
expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false);
|
||||
});
|
||||
test('missing resource icon is not shown type is workflow_job_template', () => {
|
||||
const wrapper = mountWithContexts(
|
||||
<TemplatesListItem
|
||||
isSelected={false}
|
||||
template={{
|
||||
id: 1,
|
||||
name: 'Template 1',
|
||||
url: '/templates/job_template/1',
|
||||
type: 'workflow_job_template',
|
||||
summary_fields: {
|
||||
user_capabilities: {
|
||||
edit: false,
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user