mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure we can edit grid values in the debugger using keyboard shortcuts. Fixes #3153
This commit is contained in:
committed by
Dave Page
parent
efcf87636d
commit
92a0bb605d
44
web/regression/javascript/debugger_utils_spec.js
Normal file
44
web/regression/javascript/debugger_utils_spec.js
Normal file
@@ -0,0 +1,44 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// pgAdmin 4 - PostgreSQL Tools
|
||||
//
|
||||
// Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import { setFocusToDebuggerEditor } from '../../pgadmin/tools/debugger/static/js/debugger_utils';
|
||||
|
||||
describe('debuggerUtils', function () {
|
||||
let editor;
|
||||
editor = jasmine.createSpyObj('editor', ['focus']);
|
||||
|
||||
let tab_key = {
|
||||
which: 9,
|
||||
keyCode: 9,
|
||||
}
|
||||
|
||||
let enter_key = {
|
||||
which: 13,
|
||||
keyCode: 13,
|
||||
}
|
||||
|
||||
describe('debuggerUtils', function () {
|
||||
it('returns undefined if no command is passed', function () {
|
||||
expect(setFocusToDebuggerEditor(editor, null)).toEqual(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
describe('debuggerUtils', function () {
|
||||
it('should call focus on editor', function () {
|
||||
setFocusToDebuggerEditor(editor, enter_key)
|
||||
expect(editor.focus).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('debuggerUtils', function () {
|
||||
it('should not call focus on editor and returns undefined', function () {
|
||||
expect(setFocusToDebuggerEditor(editor, tab_key)).toEqual(undefined);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user