2021-02-02 03:17:58 -06:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2024-01-01 02:43:48 -06:00
|
|
|
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
2021-02-02 03:17:58 -06:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
import React from 'react';
|
2023-10-23 07:13:17 -05:00
|
|
|
import QuickSearch from '../../../pgadmin/static/js/QuickSearch';
|
|
|
|
import { render } from '@testing-library/react';
|
2024-04-08 21:51:14 -05:00
|
|
|
import Theme from '../../../pgadmin/static/js/Theme';
|
2021-02-02 03:17:58 -06:00
|
|
|
|
2023-10-23 07:13:17 -05:00
|
|
|
let ctrl;
|
2021-02-02 03:17:58 -06:00
|
|
|
|
|
|
|
describe('quick search test cases', function () {
|
|
|
|
beforeEach(() => {
|
2023-10-23 07:13:17 -05:00
|
|
|
ctrl = render(
|
2024-04-08 21:51:14 -05:00
|
|
|
<Theme>
|
|
|
|
<QuickSearch />
|
|
|
|
</Theme>
|
2023-10-23 07:13:17 -05:00
|
|
|
);
|
2021-02-02 03:17:58 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have rendered quick-search-container', () => {
|
2023-10-23 07:13:17 -05:00
|
|
|
expect(ctrl.container.firstChild.id).toEqual('quick-search-container');
|
2021-02-02 03:17:58 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have 2 childs in quick-search-container', () => {
|
2023-10-23 07:13:17 -05:00
|
|
|
expect(ctrl.container.firstChild.childNodes.length).toEqual(2);
|
2021-02-02 03:17:58 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
it('element should be html element', () => {
|
2023-10-23 07:13:17 -05:00
|
|
|
expect(ctrl.container.querySelector('#live-search-field')).not.toBeNull();
|
2021-02-02 03:17:58 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|