Added Quick Search functionality for menu items and help articles. Fixes #6148

This commit is contained in:
Pramod Ahire
2021-02-02 14:47:58 +05:30
committed by Akshay Joshi
parent f7214b7cfe
commit b948f43dda
36 changed files with 877 additions and 25 deletions
@@ -70,7 +70,7 @@ describe('For Activity', function(){
expect(pgBrowser.get_epoch_now).not.toHaveBeenCalled();
});
it('set loggin to false after timeout', function(done){
it('set login to false after timeout', function(done){
pgBrowser.log_activity();
expect(pgBrowser.logging_activity).toEqual(true);
setTimeout(()=>{
@@ -0,0 +1,44 @@
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin 4 - PostgreSQL Tools
//
// Copyright (C) 2013 - 2021, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
//////////////////////////////////////////////////////////////////////////
import React from 'react';
import ReactDOM from 'react-dom';
import { act } from 'react-dom/test-utils';
import { Search } from 'browser/quick_search/trigger_search';
let container;
describe('quick search test cases', function () {
beforeEach(() => {
container = document.createElement('div');
document.body.appendChild(container);
act(() => {
ReactDOM.render(<Search />, container);
});
});
afterEach(() => {
document.body.removeChild(container);
container = null;
});
it('should have rendered quick-search-container', () => {
expect(container.firstChild.id).toEqual('quick-search-container');
});
it('should have 2 childs in quick-search-container', () => {
expect(container.firstChild.childNodes.length).toEqual(2);
});
it('element should be html element', () => {
let inputElement = document.getElementById('live-search-field');
expect(inputElement instanceof HTMLElement).toBeTruthy();
});
});