mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 11:55:04 -02: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:
@@ -63,9 +63,11 @@ class TemplateListItem extends Component {
|
|||||||
const { i18n, template, isSelected, onSelect } = this.props;
|
const { i18n, template, isSelected, onSelect } = this.props;
|
||||||
const canLaunch = template.summary_fields.user_capabilities.start;
|
const canLaunch = template.summary_fields.user_capabilities.start;
|
||||||
const missingResourceIcon =
|
const missingResourceIcon =
|
||||||
(!template.summary_fields.inventory &&
|
template.type === 'job_template' &&
|
||||||
!template.ask_inventory_on_launch) ||
|
(!template.summary_fields.project ||
|
||||||
!template.summary_fields.project;
|
(!template.summary_fields.inventory &&
|
||||||
|
!template.ask_inventory_on_launch));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DataListItem
|
<DataListItem
|
||||||
aria-labelledby={`check-action-${template.id}`}
|
aria-labelledby={`check-action-${template.id}`}
|
||||||
|
|||||||
@@ -142,4 +142,23 @@ describe('<TemplatesListItem />', () => {
|
|||||||
);
|
);
|
||||||
expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false);
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user