diff --git a/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx index fc371c7afc..e7be152653 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryAdd/InventoryAdd.test.jsx @@ -51,11 +51,13 @@ describe('', () => { ]; await waitForElement(wrapper, 'isLoading', el => el.length === 0); - wrapper.find('InventoryForm').prop('onSubmit')({ - name: 'new Foo', - organization: { id: 2 }, - insights_credential: { id: 47 }, - instanceGroups, + await act(async () => { + wrapper.find('InventoryForm').prop('onSubmit')({ + name: 'new Foo', + organization: { id: 2 }, + insights_credential: { id: 47 }, + instanceGroups, + }); }); await sleep(1); expect(InventoriesAPI.create).toHaveBeenCalledWith({ @@ -74,7 +76,9 @@ describe('', () => { test('handleCancel should return the user back to the inventories list', async () => { await waitForElement(wrapper, 'isLoading', el => el.length === 0); - wrapper.find('Button[aria-label="Cancel"]').simulate('click'); + await act(async () => { + wrapper.find('Button[aria-label="Cancel"]').simulate('click'); + }); expect(history.location.pathname).toEqual('/inventories'); }); }); diff --git a/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx b/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx index e2e86956bb..0bb768e895 100644 --- a/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx +++ b/awx/ui_next/src/screens/Inventory/InventoryEdit/InventoryEdit.test.jsx @@ -102,7 +102,9 @@ describe('', () => { test('handleCancel returns the user to inventory detail', async () => { await waitForElement(wrapper, 'isLoading', el => el.length === 0); - wrapper.find('Button[aria-label="Cancel"]').simulate('click'); + await act(async () => { + wrapper.find('Button[aria-label="Cancel"]').simulate('click'); + }); expect(history.location.pathname).toEqual( '/inventories/inventory/1/details' ); @@ -114,12 +116,14 @@ describe('', () => { { name: 'Bizz', id: 2 }, { name: 'Buzz', id: 3 }, ]; - wrapper.find('InventoryForm').prop('onSubmit')({ - name: 'Foo', - id: 13, - organization: { id: 1 }, - insights_credential: { id: 13 }, - instanceGroups, + await act(async () => { + wrapper.find('InventoryForm').prop('onSubmit')({ + name: 'Foo', + id: 13, + organization: { id: 1 }, + insights_credential: { id: 13 }, + instanceGroups, + }); }); await sleep(0); instanceGroups.map(IG =>