mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-14 20:11:48 -05:00
fix tests with search updates
This commit is contained in:
@@ -5,6 +5,13 @@ import Search from './Search';
|
||||
describe('<Search />', () => {
|
||||
let search;
|
||||
|
||||
const QS_CONFIG = {
|
||||
namespace: 'organization',
|
||||
dateFields: [ 'modified', 'created' ],
|
||||
defaultParams: { page: 1, page_size: 5, order_by: 'name' },
|
||||
integerFields: ['page', 'page_size'],
|
||||
};
|
||||
|
||||
afterEach(() => {
|
||||
if (search) {
|
||||
search = null;
|
||||
@@ -22,7 +29,7 @@ describe('<Search />', () => {
|
||||
const onSearch = jest.fn();
|
||||
|
||||
search = mountWithContexts(
|
||||
<Search sortedColumnKey="name" columns={columns} onSearch={onSearch} />
|
||||
<Search qsConfig={QS_CONFIG} sortedColumnKey="name" columns={columns} onSearch={onSearch} />
|
||||
);
|
||||
|
||||
search.find(searchTextInput).instance().value = 'test-321';
|
||||
@@ -39,7 +46,7 @@ describe('<Search />', () => {
|
||||
];
|
||||
const onSearch = jest.fn();
|
||||
const wrapper = mountWithContexts(
|
||||
<Search sortedColumnKey="name" columns={columns} onSearch={onSearch} />
|
||||
<Search qsConfig={QS_CONFIG} sortedColumnKey="name" columns={columns} onSearch={onSearch} />
|
||||
).find('Search');
|
||||
expect(wrapper.state('isSearchDropdownOpen')).toEqual(false);
|
||||
wrapper.instance().handleDropdownToggle(true);
|
||||
@@ -58,7 +65,7 @@ describe('<Search />', () => {
|
||||
];
|
||||
const onSearch = jest.fn();
|
||||
const wrapper = mountWithContexts(
|
||||
<Search sortedColumnKey="name" columns={columns} onSearch={onSearch} />
|
||||
<Search qsConfig={QS_CONFIG} sortedColumnKey="name" columns={columns} onSearch={onSearch} />
|
||||
).find('Search');
|
||||
expect(wrapper.state('searchKey')).toEqual('name');
|
||||
wrapper
|
||||
|
||||
Reference in New Issue
Block a user