From e57bd88bd24c2976110ceffefb914a2283a491a1 Mon Sep 17 00:00:00 2001 From: Keith Grant Date: Tue, 19 May 2020 08:58:48 -0700 Subject: [PATCH] add Lookup test for disabled isLoading state --- .../src/components/Lookup/Lookup.test.jsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/awx/ui_next/src/components/Lookup/Lookup.test.jsx b/awx/ui_next/src/components/Lookup/Lookup.test.jsx index 7fb1ed464c..bcb4d9fdc1 100644 --- a/awx/ui_next/src/components/Lookup/Lookup.test.jsx +++ b/awx/ui_next/src/components/Lookup/Lookup.test.jsx @@ -159,4 +159,30 @@ describe('', () => { const list = wrapper.find('TestList'); expect(list.prop('canDelete')).toEqual(false); }); + + test('should be disabled while isLoading is true', async () => { + const mockSelected = [{ name: 'foo', id: 1, url: '/api/v2/item/1' }]; + wrapper = mountWithContexts( + ( + + )} + /> + ); + checkRootElementNotPresent('body div[role="dialog"]'); + const button = wrapper.find('button[aria-label="Search"]'); + expect(button.prop('disabled')).toEqual(true); + }); });