From 21890efca6c798337355d768cfdb4ae6ae74dc26 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Thu, 23 Jan 2020 10:53:41 -0500 Subject: [PATCH] Ensures no missingResourceIcon for WFJT on JTList Adds a test to ensure that missingResourceIcon is not shown for WFJTs. --- .../TemplateList/TemplateListItem.jsx | 8 +++++--- .../TemplateList/TemplatesListItem.test.jsx | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx b/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx index 55ceca10c9..bba635470f 100644 --- a/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx +++ b/awx/ui_next/src/screens/Template/TemplateList/TemplateListItem.jsx @@ -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 ( ', () => { ); expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false); }); + test('missing resource icon is not shown type is workflow_job_template', () => { + const wrapper = mountWithContexts( + + ); + expect(wrapper.find('ExclamationTriangleIcon').exists()).toBe(false); + }); });