From 81c16f4fa7d27a8c1b4b2d09a82527175b53e454 Mon Sep 17 00:00:00 2001 From: "Keith J. Grant" Date: Fri, 9 Jul 2021 09:08:32 -0700 Subject: [PATCH] remove 3rd batch of unmount calls --- .../shared/ExecutionEnvironmentForm.test.jsx | 1 - .../Host/HostGroups/HostGroupsList.test.jsx | 1 - .../ContainerGroupAdd.test.jsx | 1 - .../ContainerGroupEdit.test.jsx | 1 - .../InstanceGroupAdd.test.jsx | 1 - .../shared/ContainerGroupForm.test.jsx | 1 - .../shared/InstanceGroupForm.test.jsx | 1 - .../screens/Inventory/Inventories.test.jsx | 8 ---- .../InventoryGroupHostList.test.jsx | 1 - .../InventoryGroupHostListItem.test.jsx | 4 -- .../InventoryGroupsList.test.jsx | 2 - .../InventoryHost/InventoryHost.test.jsx | 4 -- .../InventoryHostGroupsList.test.jsx | 1 - .../InventoryHosts/InventoryHostItem.test.jsx | 4 -- .../InventoryHosts/InventoryHosts.test.jsx | 9 ++++- .../InventoryRelatedGroupList.test.jsx | 1 - .../InventorySourceAdd.test.jsx | 1 - .../InventorySourceListItem.test.jsx | 1 - .../InventorySources.test.jsx | 1 - .../screens/Inventory/SmartInventory.test.jsx | 1 - .../SmartInventoryHost.test.jsx | 1 - .../SmartInventoryHostList.test.jsx | 1 - .../SmartInventoryHostListItem.test.jsx | 4 -- .../SmartInventoryHosts.test.jsx | 12 +++++- .../shared/InventorySourceSyncButton.test.jsx | 1 - .../JobOutput/shared/HostStatusBar.test.jsx | 4 -- .../JobOutput/shared/OutputToolbar.test.jsx | 4 -- .../WorkflowOutput/WorkflowOutput.test.jsx | 1 - .../WorkflowOutputToolbar.test.jsx | 4 -- .../ManagementJob/ManagementJobs.test.jsx | 8 ---- .../src/screens/Metrics/Metrics.test.jsx | 1 - .../NotificationTemplates.test.jsx | 29 ++++++-------- .../src/screens/Project/Projects.test.jsx | 37 ++++-------------- .../Project/shared/ProjectForm.test.jsx | 1 - .../screens/Schedule/AllSchedules.test.jsx | 38 ++++--------------- .../Jobs/JobsDetail/JobsDetail.test.jsx | 1 - .../src/screens/Setting/LDAP/LDAP.test.jsx | 1 - .../LDAP/LDAPDetail/LDAPDetail.test.jsx | 1 - .../screens/Setting/Logging/Logging.test.jsx | 1 - .../LoggingDetail/LoggingDetail.test.jsx | 1 - .../MiscAuthentication.test.jsx | 1 - .../Setting/MiscSystem/MiscSystem.test.jsx | 1 - .../screens/Setting/RADIUS/RADIUS.test.jsx | 1 - .../RADIUS/RADIUSEdit/RADIUSEdit.test.jsx | 1 - .../SAML/SAMLDetail/SAMLDetail.test.jsx | 1 - .../src/screens/Setting/SettingList.test.jsx | 4 +- .../src/screens/Setting/Settings.test.jsx | 1 - .../Subscription/Subscription.test.jsx | 1 - .../SubscriptionDetail.test.jsx | 4 -- .../SubscriptionEdit/AnalyticsStep.test.jsx | 1 - .../SubscriptionEdit/EulaStep.test.jsx | 1 - .../SubscriptionModal.test.jsx | 1 - .../SubscriptionStep.test.jsx | 1 - .../screens/Setting/TACACS/TACACS.test.jsx | 1 - .../TACACS/TACACSDetail/TACACSDetail.test.jsx | 1 - .../TACACS/TACACSEdit/TACACSEdit.test.jsx | 1 - .../src/screens/Setting/UI/UI.test.jsx | 1 - .../Setting/UI/UIDetail/UIDetail.test.jsx | 1 - .../screens/Setting/UI/UIEdit/UIEdit.test.jsx | 1 - .../Setting/shared/RevertAllAlert.test.jsx | 1 - .../Setting/shared/RevertButton.test.jsx | 4 -- .../shared/RevertFormActionGroup.test.jsx | 1 - .../Team/TeamDetail/TeamDetail.test.jsx | 4 -- .../Team/TeamRoles/TeamRolesList.test.jsx | 1 - .../src/screens/Team/shared/TeamForm.test.jsx | 1 - .../Survey/SurveyPreviewModal.test.jsx | 6 --- .../Survey/SurveyQuestionEdit.test.jsx | 6 --- .../src/screens/Template/Templates.test.jsx | 8 ---- .../Template/shared/WebhookSubForm.test.jsx | 9 +++-- 69 files changed, 51 insertions(+), 211 deletions(-) diff --git a/awx/ui_next/src/screens/ExecutionEnvironment/shared/ExecutionEnvironmentForm.test.jsx b/awx/ui_next/src/screens/ExecutionEnvironment/shared/ExecutionEnvironmentForm.test.jsx index dadf06176a..1308eeda7d 100644 --- a/awx/ui_next/src/screens/ExecutionEnvironment/shared/ExecutionEnvironmentForm.test.jsx +++ b/awx/ui_next/src/screens/ExecutionEnvironment/shared/ExecutionEnvironmentForm.test.jsx @@ -145,7 +145,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('Initially renders successfully', () => { diff --git a/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.test.jsx b/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.test.jsx index 65cf233717..26fee4978d 100644 --- a/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.test.jsx +++ b/awx/ui_next/src/screens/Host/HostGroups/HostGroupsList.test.jsx @@ -108,7 +108,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders successfully', () => { diff --git a/awx/ui_next/src/screens/InstanceGroup/ContainerGroupAdd/ContainerGroupAdd.test.jsx b/awx/ui_next/src/screens/InstanceGroup/ContainerGroupAdd/ContainerGroupAdd.test.jsx index de9782eb58..08c46843ef 100644 --- a/awx/ui_next/src/screens/InstanceGroup/ContainerGroupAdd/ContainerGroupAdd.test.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/ContainerGroupAdd/ContainerGroupAdd.test.jsx @@ -67,7 +67,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('handleSubmit should call the api and redirect to details page', async () => { diff --git a/awx/ui_next/src/screens/InstanceGroup/ContainerGroupEdit/ContainerGroupEdit.test.jsx b/awx/ui_next/src/screens/InstanceGroup/ContainerGroupEdit/ContainerGroupEdit.test.jsx index f2d035c56c..6c8efccffc 100644 --- a/awx/ui_next/src/screens/InstanceGroup/ContainerGroupEdit/ContainerGroupEdit.test.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/ContainerGroupEdit/ContainerGroupEdit.test.jsx @@ -113,7 +113,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders successfully', async () => { diff --git a/awx/ui_next/src/screens/InstanceGroup/InstanceGroupAdd/InstanceGroupAdd.test.jsx b/awx/ui_next/src/screens/InstanceGroup/InstanceGroupAdd/InstanceGroupAdd.test.jsx index 1fb1d24927..029fe151de 100644 --- a/awx/ui_next/src/screens/InstanceGroup/InstanceGroupAdd/InstanceGroupAdd.test.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/InstanceGroupAdd/InstanceGroupAdd.test.jsx @@ -63,7 +63,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('handleSubmit should call the api and redirect to details page', async () => { diff --git a/awx/ui_next/src/screens/InstanceGroup/shared/ContainerGroupForm.test.jsx b/awx/ui_next/src/screens/InstanceGroup/shared/ContainerGroupForm.test.jsx index 29bfbb68ab..bd9859c122 100644 --- a/awx/ui_next/src/screens/InstanceGroup/shared/ContainerGroupForm.test.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/shared/ContainerGroupForm.test.jsx @@ -91,7 +91,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('Initially renders successfully', () => { diff --git a/awx/ui_next/src/screens/InstanceGroup/shared/InstanceGroupForm.test.jsx b/awx/ui_next/src/screens/InstanceGroup/shared/InstanceGroupForm.test.jsx index cb646ed608..8c03388d25 100644 --- a/awx/ui_next/src/screens/InstanceGroup/shared/InstanceGroupForm.test.jsx +++ b/awx/ui_next/src/screens/InstanceGroup/shared/InstanceGroupForm.test.jsx @@ -60,7 +60,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('Initially renders successfully', () => { diff --git a/awx/ui_next/src/screens/Inventory/Inventories.test.jsx b/awx/ui_next/src/screens/Inventory/Inventories.test.jsx index 35e1ee5da0..23b5779e9c 100644 --- a/awx/ui_next/src/screens/Inventory/Inventories.test.jsx +++ b/awx/ui_next/src/screens/Inventory/Inventories.test.jsx @@ -4,10 +4,6 @@ import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import Inventories from './Inventories'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), -})); - describe('', () => { let pageWrapper; @@ -15,10 +11,6 @@ describe('', () => { pageWrapper = mountWithContexts(); }); - afterEach(() => { - pageWrapper.unmount(); - }); - test('initially renders without crashing', () => { expect(pageWrapper.length).toBe(1); }); diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.test.jsx index 0ff7be6cc5..1fa3745996 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostList.test.jsx @@ -43,7 +43,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders successfully ', () => { diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostListItem.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostListItem.test.jsx index 85ea79463e..60bccf5507 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostListItem.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroupHosts/InventoryGroupHostListItem.test.jsx @@ -26,10 +26,6 @@ describe('', () => { ); }); - afterEach(() => { - wrapper.unmount(); - }); - test('should display expected row item content', () => { expect(wrapper.find('b').text()).toContain( '.host-000001.group-00000.dummy' diff --git a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx index 1dbd23b030..bd449de002 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryGroups/InventoryGroupsList.test.jsx @@ -96,7 +96,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('should fetch groups from api and render them in the list', async () => { @@ -201,7 +200,6 @@ describe(' error handling', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('should show content error when api throws error on initial render', async () => { diff --git a/awx/ui_next/src/screens/Inventory/InventoryHost/InventoryHost.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryHost/InventoryHost.test.jsx index 8334c35794..ed3f314123 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHost/InventoryHost.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHost/InventoryHost.test.jsx @@ -41,10 +41,6 @@ describe('', () => { }); }); - afterEach(() => { - wrapper.unmount(); - }); - test('should render expected tabs', async () => { const expectedTabs = [ 'Back to Hosts', diff --git a/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.test.jsx index 043618c46a..9f46e5747e 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHostGroups/InventoryHostGroupsList.test.jsx @@ -100,7 +100,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders successfully', () => { diff --git a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.test.jsx index ce047cdaea..d5ab865de0 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHostItem.test.jsx @@ -44,10 +44,6 @@ describe('', () => { ); }); - afterEach(() => { - wrapper.unmount(); - }); - test('edit button shown to users with edit capabilities', () => { expect(wrapper.find('PencilAltIcon').exists()).toBeTruthy(); }); diff --git a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHosts.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHosts.test.jsx index 4b25da701b..c9b0ec3d75 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHosts.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryHosts/InventoryHosts.test.jsx @@ -3,6 +3,14 @@ import { createMemoryHistory } from 'history'; import { mountWithContexts } from '../../../../testUtils/enzymeHelpers'; import InventoryHosts from './InventoryHosts'; +jest.mock('./InventoryHostList', () => { + const InventoryHostList = () =>
; + return { + __esModule: true, + default: InventoryHostList, + }; +}); + describe('', () => { test('should render inventory host list', () => { const history = createMemoryHistory({ @@ -20,6 +28,5 @@ describe('', () => { }); expect(wrapper.find('InventoryHostList').length).toBe(1); - wrapper.unmount(); }); }); diff --git a/awx/ui_next/src/screens/Inventory/InventoryRelatedGroups/InventoryRelatedGroupList.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryRelatedGroups/InventoryRelatedGroupList.test.jsx index 277a53413e..342090588b 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryRelatedGroups/InventoryRelatedGroupList.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryRelatedGroups/InventoryRelatedGroupList.test.jsx @@ -95,7 +95,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders successfully ', () => { diff --git a/awx/ui_next/src/screens/Inventory/InventorySourceAdd/InventorySourceAdd.test.jsx b/awx/ui_next/src/screens/Inventory/InventorySourceAdd/InventorySourceAdd.test.jsx index d9d0705b84..cb18aadca9 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySourceAdd/InventorySourceAdd.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySourceAdd/InventorySourceAdd.test.jsx @@ -72,7 +72,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('new form displays primary form fields', async () => { diff --git a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceListItem.test.jsx b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceListItem.test.jsx index 58d815e8a2..deebb67fc6 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceListItem.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySourceListItem.test.jsx @@ -23,7 +23,6 @@ const source = { describe('', () => { let wrapper; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySources.test.jsx b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySources.test.jsx index dba54734da..ee6b0bd75a 100644 --- a/awx/ui_next/src/screens/Inventory/InventorySources/InventorySources.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventorySources/InventorySources.test.jsx @@ -6,6 +6,5 @@ describe('', () => { test('initially renders without crashing', () => { const wrapper = shallow(); expect(wrapper.length).toBe(1); - wrapper.unmount(); }); }); diff --git a/awx/ui_next/src/screens/Inventory/SmartInventory.test.jsx b/awx/ui_next/src/screens/Inventory/SmartInventory.test.jsx index ffbcaf7490..21d67ba48a 100644 --- a/awx/ui_next/src/screens/Inventory/SmartInventory.test.jsx +++ b/awx/ui_next/src/screens/Inventory/SmartInventory.test.jsx @@ -22,7 +22,6 @@ describe('', () => { let wrapper; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Inventory/SmartInventoryHost/SmartInventoryHost.test.jsx b/awx/ui_next/src/screens/Inventory/SmartInventoryHost/SmartInventoryHost.test.jsx index 93bff59d87..c7f04f55c2 100644 --- a/awx/ui_next/src/screens/Inventory/SmartInventoryHost/SmartInventoryHost.test.jsx +++ b/awx/ui_next/src/screens/Inventory/SmartInventoryHost/SmartInventoryHost.test.jsx @@ -29,7 +29,6 @@ describe('', () => { let history; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostList.test.jsx b/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostList.test.jsx index fe9dfa022b..ede08d64f4 100644 --- a/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostList.test.jsx +++ b/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostList.test.jsx @@ -37,7 +37,6 @@ describe('', () => { afterAll(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders successfully', () => { diff --git a/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostListItem.test.jsx b/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostListItem.test.jsx index 6c525d13d9..b3d26782ca 100644 --- a/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostListItem.test.jsx +++ b/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHostListItem.test.jsx @@ -37,10 +37,6 @@ describe('', () => { ); }); - afterEach(() => { - wrapper.unmount(); - }); - test('should render expected row cells', () => { const cells = wrapper.find('Td'); expect(cells).toHaveLength(4); diff --git a/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHosts.test.jsx b/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHosts.test.jsx index 1db767dfe4..d159e8cd7f 100644 --- a/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHosts.test.jsx +++ b/awx/ui_next/src/screens/Inventory/SmartInventoryHosts/SmartInventoryHosts.test.jsx @@ -8,6 +8,13 @@ import { import SmartInventoryHosts from './SmartInventoryHosts'; jest.mock('../../../api'); +jest.mock('./SmartInventoryHostList', () => { + const SmartInventoryHostList = () =>
; + return { + __esModule: true, + default: SmartInventoryHostList, + }; +}); describe('', () => { test('should render smart inventory host list', () => { @@ -26,8 +33,10 @@ describe('', () => { } ); expect(wrapper.find('SmartInventoryHostList').length).toBe(1); + expect(wrapper.find('SmartInventoryHostList').prop('inventory')).toEqual({ + id: 1, + }); jest.clearAllMocks(); - wrapper.unmount(); }); test('should render smart inventory host details', async () => { @@ -51,6 +60,5 @@ describe('', () => { await waitForElement(wrapper, 'ContentLoading', el => el.length === 0); expect(wrapper.find('SmartInventoryHost').length).toBe(1); jest.clearAllMocks(); - wrapper.unmount(); }); }); diff --git a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSyncButton.test.jsx b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSyncButton.test.jsx index b7c8508d99..011a8816d7 100644 --- a/awx/ui_next/src/screens/Inventory/shared/InventorySourceSyncButton.test.jsx +++ b/awx/ui_next/src/screens/Inventory/shared/InventorySourceSyncButton.test.jsx @@ -21,7 +21,6 @@ describe('', () => { ); }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx b/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx index 7e4237ba60..623557126f 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/shared/HostStatusBar.test.jsx @@ -13,10 +13,6 @@ describe('', () => { wrapper = mountWithContexts(); }); - afterEach(() => { - wrapper.unmount(); - }); - test('initially renders without crashing', () => { expect(wrapper.length).toBe(1); }); diff --git a/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.test.jsx b/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.test.jsx index 2fa8ca29ae..a1cbc4cafb 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.test.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/shared/OutputToolbar.test.jsx @@ -22,10 +22,6 @@ describe('', () => { ); }); - afterEach(() => { - wrapper.unmount(); - }); - test('initially renders without crashing', () => { expect(wrapper.length).toBe(1); }); diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutput.test.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutput.test.jsx index eaea9a2162..91c25293f3 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutput.test.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutput.test.jsx @@ -115,7 +115,6 @@ describe('WorkflowOutput', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); delete window.SVGElement.prototype.getBBox; delete window.SVGElement.prototype.getBoundingClientRect; delete window.SVGElement.prototype.height; diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.test.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.test.jsx index b597c35f0d..3f365f9868 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.test.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputToolbar.test.jsx @@ -44,10 +44,6 @@ describe('WorkflowOutputToolbar', () => { ); }); - afterAll(() => { - wrapper.unmount(); - }); - test('should render correct toolbar item', () => { shouldFind(`Button[ouiaId="edit-workflow"]`); shouldFind('Button#workflow-output-toggle-legend'); diff --git a/awx/ui_next/src/screens/ManagementJob/ManagementJobs.test.jsx b/awx/ui_next/src/screens/ManagementJob/ManagementJobs.test.jsx index 04e9ed4894..173d343633 100644 --- a/awx/ui_next/src/screens/ManagementJob/ManagementJobs.test.jsx +++ b/awx/ui_next/src/screens/ManagementJob/ManagementJobs.test.jsx @@ -4,10 +4,6 @@ import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import ManagementJobs from './ManagementJobs'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), -})); - describe('', () => { let pageWrapper; let pageSections; @@ -17,10 +13,6 @@ describe('', () => { pageSections = pageWrapper.find('PageSection'); }); - afterEach(() => { - pageWrapper.unmount(); - }); - test('renders ok', () => { expect(pageWrapper.length).toBe(1); expect(pageWrapper.find('ScreenHeader').length).toBe(1); diff --git a/awx/ui_next/src/screens/Metrics/Metrics.test.jsx b/awx/ui_next/src/screens/Metrics/Metrics.test.jsx index b317e2e568..33b36e1b10 100644 --- a/awx/ui_next/src/screens/Metrics/Metrics.test.jsx +++ b/awx/ui_next/src/screens/Metrics/Metrics.test.jsx @@ -33,7 +33,6 @@ describe('', () => { }); }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); test('should mound properly', () => { diff --git a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplates.test.jsx b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplates.test.jsx index f8b02d4735..63ac3898be 100644 --- a/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplates.test.jsx +++ b/awx/ui_next/src/screens/NotificationTemplate/NotificationTemplates.test.jsx @@ -2,26 +2,21 @@ import React from 'react'; import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import NotificationTemplates from './NotificationTemplates'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), -})); +jest.mock('./NotificationTemplateList', () => { + const NotificationTemplateList = () =>
; + return { + __esModule: true, + default: NotificationTemplateList, + }; +}); describe('', () => { - let pageWrapper; - let pageSections; - - beforeEach(() => { - pageWrapper = mountWithContexts(); - pageSections = pageWrapper.find('PageSection'); - }); - - afterEach(() => { - pageWrapper.unmount(); - }); - test('initially renders without crashing', () => { - expect(pageWrapper.length).toBe(1); - expect(pageSections.length).toBe(2); + const wrapper = mountWithContexts(); + + const pageSections = wrapper.find('PageSection'); + expect(pageSections).toHaveLength(1); expect(pageSections.first().props().variant).toBe('light'); + expect(wrapper.find('NotificationTemplateList')).toHaveLength(1); }); }); diff --git a/awx/ui_next/src/screens/Project/Projects.test.jsx b/awx/ui_next/src/screens/Project/Projects.test.jsx index 2e4023c9b9..b7e734700a 100644 --- a/awx/ui_next/src/screens/Project/Projects.test.jsx +++ b/awx/ui_next/src/screens/Project/Projects.test.jsx @@ -1,37 +1,16 @@ import React from 'react'; -import { createMemoryHistory } from 'history'; - -import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; - -import Projects from './Projects'; - -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), -})); +import { shallow } from 'enzyme'; +import { _Projects as Projects } from './Projects'; describe('', () => { - test('initially renders successfully', () => { - mountWithContexts(); - }); - test('should display a breadcrumb heading', () => { - const history = createMemoryHistory({ - initialEntries: ['/projects'], - }); - const match = { path: '/projects', url: '/projects', isExact: true }; + const wrapper = shallow(); - const wrapper = mountWithContexts(, { - context: { - router: { - history, - route: { - location: history.location, - match, - }, - }, - }, + const header = wrapper.find('ScreenHeader'); + expect(header.prop('streamType')).toBe('project'); + expect(header.prop('breadcrumbConfig')).toEqual({ + '/projects': 'Projects', + '/projects/add': 'Create New Project', }); - expect(wrapper.find('Title').length).toBe(1); - wrapper.unmount(); }); }); diff --git a/awx/ui_next/src/screens/Project/shared/ProjectForm.test.jsx b/awx/ui_next/src/screens/Project/shared/ProjectForm.test.jsx index 8c99c0b6c7..b466f49e47 100644 --- a/awx/ui_next/src/screens/Project/shared/ProjectForm.test.jsx +++ b/awx/ui_next/src/screens/Project/shared/ProjectForm.test.jsx @@ -98,7 +98,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Schedule/AllSchedules.test.jsx b/awx/ui_next/src/screens/Schedule/AllSchedules.test.jsx index 9015571e7b..82bedfc97b 100644 --- a/awx/ui_next/src/screens/Schedule/AllSchedules.test.jsx +++ b/awx/ui_next/src/screens/Schedule/AllSchedules.test.jsx @@ -1,39 +1,15 @@ import React from 'react'; -import { createMemoryHistory } from 'history'; -import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; +import { shallow } from 'enzyme'; import AllSchedules from './AllSchedules'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), -})); - describe('', () => { - let wrapper; + test('should set breadcrumb config', () => { + const wrapper = shallow(); - afterEach(() => { - wrapper.unmount(); - }); - - test('initially renders successfully', () => { - wrapper = mountWithContexts(); - }); - - test('should display schedule list breadcrumb heading', () => { - const history = createMemoryHistory({ - initialEntries: ['/schedules'], + const header = wrapper.find('ScreenHeader'); + expect(header.prop('streamType')).toEqual('schedule'); + expect(header.prop('breadcrumbConfig')).toEqual({ + '/schedules': 'Schedules', }); - - wrapper = mountWithContexts(, { - context: { - router: { - history, - route: { - location: history.location, - }, - }, - }, - }); - - expect(wrapper.find('Title').text()).toBe('Schedules'); }); }); diff --git a/awx/ui_next/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.jsx b/awx/ui_next/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.jsx index 3ebcdbe0f4..844d449910 100644 --- a/awx/ui_next/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.jsx @@ -37,7 +37,6 @@ describe('', () => { }); afterAll(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/LDAP/LDAP.test.jsx b/awx/ui_next/src/screens/Setting/LDAP/LDAP.test.jsx index 88ca337048..c2c1d0b741 100644 --- a/awx/ui_next/src/screens/Setting/LDAP/LDAP.test.jsx +++ b/awx/ui_next/src/screens/Setting/LDAP/LDAP.test.jsx @@ -18,7 +18,6 @@ describe('', () => { let wrapper; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/LDAP/LDAPDetail/LDAPDetail.test.jsx b/awx/ui_next/src/screens/Setting/LDAP/LDAPDetail/LDAPDetail.test.jsx index b326e15204..4843978287 100644 --- a/awx/ui_next/src/screens/Setting/LDAP/LDAPDetail/LDAPDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/LDAP/LDAPDetail/LDAPDetail.test.jsx @@ -46,7 +46,6 @@ describe('', () => { }); afterAll(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/Logging/Logging.test.jsx b/awx/ui_next/src/screens/Setting/Logging/Logging.test.jsx index 14f7bc5b15..1d8d82a0b6 100644 --- a/awx/ui_next/src/screens/Setting/Logging/Logging.test.jsx +++ b/awx/ui_next/src/screens/Setting/Logging/Logging.test.jsx @@ -39,7 +39,6 @@ describe('', () => { let wrapper; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/Logging/LoggingDetail/LoggingDetail.test.jsx b/awx/ui_next/src/screens/Setting/Logging/LoggingDetail/LoggingDetail.test.jsx index be2f42f559..98fb6ef4d1 100644 --- a/awx/ui_next/src/screens/Setting/Logging/LoggingDetail/LoggingDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/Logging/LoggingDetail/LoggingDetail.test.jsx @@ -34,7 +34,6 @@ describe('', () => { }); afterAll(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/MiscAuthentication/MiscAuthentication.test.jsx b/awx/ui_next/src/screens/Setting/MiscAuthentication/MiscAuthentication.test.jsx index 6d23d24933..39feca358e 100644 --- a/awx/ui_next/src/screens/Setting/MiscAuthentication/MiscAuthentication.test.jsx +++ b/awx/ui_next/src/screens/Setting/MiscAuthentication/MiscAuthentication.test.jsx @@ -20,7 +20,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/MiscSystem/MiscSystem.test.jsx b/awx/ui_next/src/screens/Setting/MiscSystem/MiscSystem.test.jsx index 341f85573b..334b492154 100644 --- a/awx/ui_next/src/screens/Setting/MiscSystem/MiscSystem.test.jsx +++ b/awx/ui_next/src/screens/Setting/MiscSystem/MiscSystem.test.jsx @@ -20,7 +20,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/RADIUS/RADIUS.test.jsx b/awx/ui_next/src/screens/Setting/RADIUS/RADIUS.test.jsx index 8406a346dd..1d4517ca19 100644 --- a/awx/ui_next/src/screens/Setting/RADIUS/RADIUS.test.jsx +++ b/awx/ui_next/src/screens/Setting/RADIUS/RADIUS.test.jsx @@ -23,7 +23,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/RADIUS/RADIUSEdit/RADIUSEdit.test.jsx b/awx/ui_next/src/screens/Setting/RADIUS/RADIUSEdit/RADIUSEdit.test.jsx index e6764fb858..5b35e43cfd 100644 --- a/awx/ui_next/src/screens/Setting/RADIUS/RADIUSEdit/RADIUSEdit.test.jsx +++ b/awx/ui_next/src/screens/Setting/RADIUS/RADIUSEdit/RADIUSEdit.test.jsx @@ -29,7 +29,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx b/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx index a32fca7b7e..8243c85637 100644 --- a/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/SAML/SAMLDetail/SAMLDetail.test.jsx @@ -54,7 +54,6 @@ describe('', () => { }); afterAll(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/SettingList.test.jsx b/awx/ui_next/src/screens/Setting/SettingList.test.jsx index 373d6ba5a4..a56f39955d 100644 --- a/awx/ui_next/src/screens/Setting/SettingList.test.jsx +++ b/awx/ui_next/src/screens/Setting/SettingList.test.jsx @@ -7,9 +7,7 @@ describe('', () => { beforeEach(() => { wrapper = mountWithContexts(); }); - afterEach(() => { - wrapper.unmount(); - }); + test('initially renders without crashing', () => { expect(wrapper.length).toBe(1); }); diff --git a/awx/ui_next/src/screens/Setting/Settings.test.jsx b/awx/ui_next/src/screens/Setting/Settings.test.jsx index 3de824527c..13b8ec77ba 100644 --- a/awx/ui_next/src/screens/Setting/Settings.test.jsx +++ b/awx/ui_next/src/screens/Setting/Settings.test.jsx @@ -30,7 +30,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/Subscription/Subscription.test.jsx b/awx/ui_next/src/screens/Setting/Subscription/Subscription.test.jsx index b286e63356..03ed7fa134 100644 --- a/awx/ui_next/src/screens/Setting/Subscription/Subscription.test.jsx +++ b/awx/ui_next/src/screens/Setting/Subscription/Subscription.test.jsx @@ -24,7 +24,6 @@ describe('', () => { let wrapper; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionDetail/SubscriptionDetail.test.jsx b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionDetail/SubscriptionDetail.test.jsx index c3f309235c..cd36291b40 100644 --- a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionDetail/SubscriptionDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionDetail/SubscriptionDetail.test.jsx @@ -44,10 +44,6 @@ describe('', () => { }); }); - afterEach(() => { - wrapper.unmount(); - }); - test('initially renders without crashing', () => { expect(wrapper.find('SubscriptionDetail').length).toBe(1); }); diff --git a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/AnalyticsStep.test.jsx b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/AnalyticsStep.test.jsx index 039bea87fb..3812f4119b 100644 --- a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/AnalyticsStep.test.jsx +++ b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/AnalyticsStep.test.jsx @@ -29,7 +29,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders without crashing', async () => { diff --git a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/EulaStep.test.jsx b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/EulaStep.test.jsx index ebb2370dd6..889b57a7e1 100644 --- a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/EulaStep.test.jsx +++ b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/EulaStep.test.jsx @@ -29,7 +29,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders without crashing', async () => { diff --git a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionModal.test.jsx b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionModal.test.jsx index 3724308409..cb41e0b8a3 100644 --- a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionModal.test.jsx +++ b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionModal.test.jsx @@ -54,7 +54,6 @@ describe('', () => { afterAll(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders without crashing', async () => { diff --git a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionStep.test.jsx b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionStep.test.jsx index ab9ad2a289..c3a8bfa314 100644 --- a/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionStep.test.jsx +++ b/awx/ui_next/src/screens/Setting/Subscription/SubscriptionEdit/SubscriptionStep.test.jsx @@ -29,7 +29,6 @@ describe('', () => { afterAll(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('initially renders without crashing', async () => { diff --git a/awx/ui_next/src/screens/Setting/TACACS/TACACS.test.jsx b/awx/ui_next/src/screens/Setting/TACACS/TACACS.test.jsx index ad8fcdbe61..71ebe071e3 100644 --- a/awx/ui_next/src/screens/Setting/TACACS/TACACS.test.jsx +++ b/awx/ui_next/src/screens/Setting/TACACS/TACACS.test.jsx @@ -22,7 +22,6 @@ describe('', () => { let wrapper; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/TACACS/TACACSDetail/TACACSDetail.test.jsx b/awx/ui_next/src/screens/Setting/TACACS/TACACSDetail/TACACSDetail.test.jsx index da6c5d8ca8..3160a32a68 100644 --- a/awx/ui_next/src/screens/Setting/TACACS/TACACSDetail/TACACSDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/TACACS/TACACSDetail/TACACSDetail.test.jsx @@ -39,7 +39,6 @@ describe('', () => { }); afterAll(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/TACACS/TACACSEdit/TACACSEdit.test.jsx b/awx/ui_next/src/screens/Setting/TACACS/TACACSEdit/TACACSEdit.test.jsx index 53e76a9e09..469d3e6bd8 100644 --- a/awx/ui_next/src/screens/Setting/TACACS/TACACSEdit/TACACSEdit.test.jsx +++ b/awx/ui_next/src/screens/Setting/TACACS/TACACSEdit/TACACSEdit.test.jsx @@ -31,7 +31,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/UI/UI.test.jsx b/awx/ui_next/src/screens/Setting/UI/UI.test.jsx index fc5aafadcd..8daecacfa8 100644 --- a/awx/ui_next/src/screens/Setting/UI/UI.test.jsx +++ b/awx/ui_next/src/screens/Setting/UI/UI.test.jsx @@ -23,7 +23,6 @@ describe('', () => { let wrapper; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.test.jsx b/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.test.jsx index 7567f1983b..254a01fb30 100644 --- a/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.test.jsx +++ b/awx/ui_next/src/screens/Setting/UI/UIDetail/UIDetail.test.jsx @@ -37,7 +37,6 @@ describe('', () => { }); afterAll(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.test.jsx b/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.test.jsx index 77ac828d36..22cff7f295 100644 --- a/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.test.jsx +++ b/awx/ui_next/src/screens/Setting/UI/UIEdit/UIEdit.test.jsx @@ -29,7 +29,6 @@ describe('', () => { }); afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.test.jsx b/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.test.jsx index a4ef356b28..dea34403cc 100644 --- a/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.test.jsx +++ b/awx/ui_next/src/screens/Setting/shared/RevertAllAlert.test.jsx @@ -8,6 +8,5 @@ describe('RevertAllAlert', () => { {}} onRevertAll={() => {}} /> ); expect(wrapper).toHaveLength(1); - wrapper.unmount(); }); }); diff --git a/awx/ui_next/src/screens/Setting/shared/RevertButton.test.jsx b/awx/ui_next/src/screens/Setting/shared/RevertButton.test.jsx index 1af4e7f223..e2801843fe 100644 --- a/awx/ui_next/src/screens/Setting/shared/RevertButton.test.jsx +++ b/awx/ui_next/src/screens/Setting/shared/RevertButton.test.jsx @@ -7,10 +7,6 @@ import RevertButton from './RevertButton'; describe('RevertButton', () => { let wrapper; - afterEach(() => { - wrapper.unmount(); - }); - test('button text should display "Revert"', async () => { wrapper = mountWithContexts( { /> ); expect(wrapper).toHaveLength(1); - wrapper.unmount(); }); }); diff --git a/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.test.jsx b/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.test.jsx index ff456ede0e..f7261ff165 100644 --- a/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.test.jsx +++ b/awx/ui_next/src/screens/Team/TeamDetail/TeamDetail.test.jsx @@ -33,10 +33,6 @@ describe('', () => { await waitForElement(wrapper, 'ContentLoading', el => el.length === 0); }); - afterEach(() => { - wrapper.unmount(); - }); - test('initially renders successfully', async () => { await waitForElement(wrapper, 'TeamDetail'); }); diff --git a/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.test.jsx b/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.test.jsx index 1ab2d0755a..15e3f72a16 100644 --- a/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.test.jsx +++ b/awx/ui_next/src/screens/Team/TeamRoles/TeamRolesList.test.jsx @@ -175,7 +175,6 @@ describe('', () => { afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); }); test('should render properly', async () => { TeamsAPI.readRoles.mockResolvedValue(roles); diff --git a/awx/ui_next/src/screens/Team/shared/TeamForm.test.jsx b/awx/ui_next/src/screens/Team/shared/TeamForm.test.jsx index 874a9f5c73..81bbf900e1 100644 --- a/awx/ui_next/src/screens/Team/shared/TeamForm.test.jsx +++ b/awx/ui_next/src/screens/Team/shared/TeamForm.test.jsx @@ -30,7 +30,6 @@ describe('', () => { }; afterEach(() => { - wrapper.unmount(); jest.clearAllMocks(); }); diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyPreviewModal.test.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyPreviewModal.test.jsx index 03a8d7f2ea..bfd0716c28 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyPreviewModal.test.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyPreviewModal.test.jsx @@ -75,12 +75,6 @@ describe('', () => { }); waitForElement(wrapper, 'Form'); }); - afterAll(() => { - wrapper.unmount(); - }); - test('renders successfully', async () => { - expect(wrapper.find('SurveyPreviewModal').length).toBe(1); - }); test('Renders proper fields', async () => { const question1 = wrapper.find('FormGroup[label="Text Question"]'); diff --git a/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.test.jsx b/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.test.jsx index de51ab4e8d..ab7ea59d55 100644 --- a/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.test.jsx +++ b/awx/ui_next/src/screens/Template/Survey/SurveyQuestionEdit.test.jsx @@ -55,10 +55,6 @@ describe('', () => { }); }); - afterEach(() => { - wrapper.unmount(); - }); - test('should render form', () => { expect(wrapper.find('SurveyQuestionForm')).toHaveLength(1); }); @@ -149,8 +145,6 @@ describe('', () => { expect(history.location.pathname).toEqual( '/templates/job_templates/1/survey' ); - - wrapper.unmount(); }); }); }); diff --git a/awx/ui_next/src/screens/Template/Templates.test.jsx b/awx/ui_next/src/screens/Template/Templates.test.jsx index 1b126cda31..0e756c2f0f 100644 --- a/awx/ui_next/src/screens/Template/Templates.test.jsx +++ b/awx/ui_next/src/screens/Template/Templates.test.jsx @@ -3,10 +3,6 @@ import { mountWithContexts } from '../../../testUtils/enzymeHelpers'; import Templates from './Templates'; -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), -})); - describe('', () => { let pageWrapper; @@ -14,10 +10,6 @@ describe('', () => { pageWrapper = mountWithContexts(); }); - afterEach(() => { - pageWrapper.unmount(); - }); - test('initially renders without crashing', () => { expect(pageWrapper.length).toBe(1); }); diff --git a/awx/ui_next/src/screens/Template/shared/WebhookSubForm.test.jsx b/awx/ui_next/src/screens/Template/shared/WebhookSubForm.test.jsx index 2f8f92da1c..19413fb369 100644 --- a/awx/ui_next/src/screens/Template/shared/WebhookSubForm.test.jsx +++ b/awx/ui_next/src/screens/Template/shared/WebhookSubForm.test.jsx @@ -23,6 +23,7 @@ describe('', () => { webhook_service: 'github', webhook_key: 'webhook key', }; + beforeEach(async () => { history = createMemoryHistory({ initialEntries: ['templates/job_template/51/edit'], @@ -51,13 +52,11 @@ describe('', () => { ); }); }); + afterEach(() => { jest.clearAllMocks(); - wrapper.unmount(); - }); - test('mounts properly', () => { - expect(wrapper.length).toBe(1); }); + test('should render initial values properly', () => { waitForElement(wrapper, 'Lookup__ChipHolder', el => el.lenth > 0); expect(wrapper.find('AnsibleSelect').prop('value')).toBe('github'); @@ -73,6 +72,7 @@ describe('', () => { 'Github credential' ); }); + test('should make other credential type available', async () => { CredentialsAPI.read.mockResolvedValue({ data: { results: [{ id: 13, name: 'GitLab credential' }] }, @@ -93,6 +93,7 @@ describe('', () => { .prop('value') ).toBe('A NEW WEBHOOK KEY WILL BE GENERATED ON SAVE.'); }); + test('should have disabled button to update webhook key', async () => { let newWrapper; await act(async () => {