fix(shortcuts): refresh data with F5
This commit is contained in:
1 parent
d7c4d3ef19
commit
28f4aec50d
9 files changed
+42
-2
No files matched your search
@@ -7,6 +7,7 @@ import {
|
||||
isExecuteSqlShortcut,
|
||||
isFocusSearchShortcut,
|
||||
isObjectSourceSaveShortcutTarget,
|
||||
isRefreshDataShortcut,
|
||||
isSaveShortcut,
|
||||
} from "../../apps/desktop/src/lib/keyboardShortcuts.ts";
|
||||
import { shortcutToCodeMirrorKey } from "../../apps/desktop/src/lib/shortcutRegistry.ts";
|
||||
@@ -67,6 +68,18 @@ test("matches Cmd+F for focusing search", () => {
|
||||
assert.equal(isFocusSearchShortcut({ key: "F", metaKey: true }), true);
|
||||
});
|
||||
|
||||
test("matches F5 for refreshing data", () => {
|
||||
assert.equal(isRefreshDataShortcut({ key: "F5" }), true);
|
||||
});
|
||||
|
||||
test("matches custom shortcut settings for refreshing data", () => {
|
||||
assert.equal(isRefreshDataShortcut({ key: "F5" }, { refreshData: "Shift+Mod+R" } as any), false);
|
||||
assert.equal(
|
||||
isRefreshDataShortcut({ key: "r", metaKey: true, shiftKey: true } as any, { refreshData: "Shift+Mod+R" } as any),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test("ignores focus search shortcut while composing", () => {
|
||||
assert.equal(isFocusSearchShortcut({ key: "f", ctrlKey: true, isComposing: true }), false);
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ test("defaults shortcut settings", () => {
|
||||
assert.equal(settings.shortcuts.executeSql, "Mod+Enter");
|
||||
assert.equal(settings.shortcuts.saveSql, "Mod+S");
|
||||
assert.equal(settings.shortcuts.focusSearch, "Mod+F");
|
||||
assert.equal(settings.shortcuts.refreshData, "F5");
|
||||
});
|
||||
|
||||
test("keeps saved shortcut overrides", () => {
|
||||
|
||||
Reference in new issue
Block a user