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