mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
7dd6372eeb
Extract some of the ACI Tree functionalities, and decouple it from the main source. Also - create some abstractions from the repeated code around the enable/disable the schema children object create/edit/delete functionalities, and also created the dialog wrappers for backup and restore dialogs. Reviewed by: Khushboo and Ashesh Refactored by: Ashesh
56 lines
1.6 KiB
JavaScript
56 lines
1.6 KiB
JavaScript
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
import keyboardShortcuts from 'sources/keyboard_shortcuts';
|
|
|
|
describe('the keyboard shortcuts', () => {
|
|
const F1_KEY = 112;
|
|
|
|
let debuggerElementSpy, event, debuggerUserShortcutSpy;
|
|
debuggerUserShortcutSpy = jasmine.createSpyObj(
|
|
'userDefinedShortcuts', [
|
|
{ 'edit_grid_keys': null },
|
|
{ 'next_panel_keys': null },
|
|
{ 'previous_panel_keys': null },
|
|
]
|
|
);
|
|
beforeEach(() => {
|
|
event = {
|
|
shift: false,
|
|
which: undefined,
|
|
preventDefault: jasmine.createSpy('preventDefault'),
|
|
cancelBubble: false,
|
|
stopPropagation: jasmine.createSpy('stopPropagation'),
|
|
stopImmediatePropagation: jasmine.createSpy('stopImmediatePropagation'),
|
|
};
|
|
});
|
|
|
|
describe('when the key is not handled by the function', function () {
|
|
beforeEach(() => {
|
|
event.which = F1_KEY;
|
|
keyboardShortcuts.processEventDebugger(
|
|
debuggerElementSpy, event, debuggerUserShortcutSpy
|
|
);
|
|
});
|
|
|
|
it('should allow event to propagate', () => {
|
|
expect(event.preventDefault).not.toHaveBeenCalled();
|
|
});
|
|
});
|
|
|
|
describe('when user wants to goto next panel', function () {
|
|
|
|
it('returns panel id', function () {
|
|
expect(keyboardShortcuts.getInnerPanel(debuggerElementSpy, 'right')).toEqual(false);
|
|
});
|
|
});
|
|
|
|
|
|
});
|