From afe36974deb2373e437af76295901f12be3c8af3 Mon Sep 17 00:00:00 2001 From: mabashian Date: Thu, 18 Feb 2021 09:14:15 -0500 Subject: [PATCH] Fix a few unit test console warnings --- .../components/Lookup/MultiCredentialsLookup.test.jsx | 2 +- awx/ui_next/src/components/Sort/Sort.test.jsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.jsx b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.jsx index a020d56345..b805a661f8 100644 --- a/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/MultiCredentialsLookup.test.jsx @@ -311,7 +311,7 @@ describe('', () => { }); wrapper.update(); const typeSelect = wrapper.find('AnsibleSelect'); - act(() => { + await act(async () => { typeSelect.invoke('onChange')({}, 500); }); wrapper.update(); diff --git a/awx/ui_next/src/components/Sort/Sort.test.jsx b/awx/ui_next/src/components/Sort/Sort.test.jsx index c6cf89ad0d..f5b1fe0d2e 100644 --- a/awx/ui_next/src/components/Sort/Sort.test.jsx +++ b/awx/ui_next/src/components/Sort/Sort.test.jsx @@ -140,10 +140,12 @@ describe('', () => { act(() => wrapper.find('Dropdown').invoke('onToggle')(true)); wrapper.update(); await waitForElement(wrapper, 'Dropdown', el => el.prop('isOpen') === true); - wrapper - .find('li') - .at(0) - .prop('onClick')({ target: { innerText: 'Bar' } }); + act(() => + wrapper + .find('li') + .at(0) + .prop('onClick')({ target: { innerText: 'Bar' } }) + ); wrapper.update(); expect(onSort).toBeCalledWith('bar', 'ascending'); });