diff --git a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx index 266bcf6d78..22ad8e2dac 100644 --- a/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx +++ b/awx/ui_next/src/components/DataListToolbar/DataListToolbar.test.jsx @@ -7,7 +7,7 @@ describe('', () => { const QS_CONFIG = { namespace: 'organization', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, order_by: 'name' }, integerFields: ['page', 'page_size'], }; diff --git a/awx/ui_next/src/components/Search/Search.jsx b/awx/ui_next/src/components/Search/Search.jsx index 2f011e05ab..020bc9d852 100644 --- a/awx/ui_next/src/components/Search/Search.jsx +++ b/awx/ui_next/src/components/Search/Search.jsx @@ -114,9 +114,9 @@ class Search extends React.Component { const { searchKey, searchValue } = this.state; const { onSearch, qsConfig } = this.props; - const isNonStringField = key => - qsConfig.integerFields.filter(field => field === key).length || - qsConfig.dateFields.filter(field => field === key).length; + const isNonStringField = + qsConfig.integerFields.filter(field => field === searchKey).length || + qsConfig.dateFields.filter(field => field === searchKey).length; // TODO: this will probably become more sophisticated, where date // fields and string fields are passed to a formatter diff --git a/awx/ui_next/src/components/Search/Search.test.jsx b/awx/ui_next/src/components/Search/Search.test.jsx index 62e1cd0b9e..d0ee274107 100644 --- a/awx/ui_next/src/components/Search/Search.test.jsx +++ b/awx/ui_next/src/components/Search/Search.test.jsx @@ -7,7 +7,7 @@ describe('', () => { const QS_CONFIG = { namespace: 'organization', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, order_by: 'name' }, integerFields: ['page', 'page_size'], }; @@ -29,7 +29,12 @@ describe('', () => { const onSearch = jest.fn(); search = mountWithContexts( - + ); search.find(searchTextInput).instance().value = 'test-321'; @@ -46,7 +51,12 @@ describe('', () => { ]; const onSearch = jest.fn(); const wrapper = mountWithContexts( - + ).find('Search'); expect(wrapper.state('isSearchDropdownOpen')).toEqual(false); wrapper.instance().handleDropdownToggle(true); @@ -65,7 +75,12 @@ describe('', () => { ]; const onSearch = jest.fn(); const wrapper = mountWithContexts( - + ).find('Search'); expect(wrapper.state('searchKey')).toEqual('name'); wrapper diff --git a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx index ee01d626a2..1095c7751c 100644 --- a/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx +++ b/awx/ui_next/src/screens/Organization/OrganizationTeams/OrganizationTeams.test.jsx @@ -65,7 +65,7 @@ describe('', () => { expect(list.prop('itemCount')).toEqual(listData.data.count); expect(list.prop('qsConfig')).toEqual({ namespace: 'team', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, diff --git a/awx/ui_next/src/util/qs.test.js b/awx/ui_next/src/util/qs.test.js index 63c9f80b05..b3c459b9ba 100644 --- a/awx/ui_next/src/util/qs.test.js +++ b/awx/ui_next/src/util/qs.test.js @@ -78,7 +78,7 @@ describe('qs (qs.js)', () => { test('should get default QS config object', () => { expect(getQSConfig('organization')).toEqual({ namespace: 'organization', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 5, order_by: 'name' }, integerFields: ['page', 'page_size'], }); @@ -95,7 +95,7 @@ describe('qs (qs.js)', () => { }; expect(getQSConfig('inventory', defaults)).toEqual({ namespace: 'inventory', - dateFields: [ 'modified', 'created' ], + dateFields: ['modified', 'created'], defaultParams: { page: 1, page_size: 15 }, integerFields: ['page', 'page_size'], });