Document keyboard shortcuts (#7908)

This commit is contained in:
Šimon Brandner 2022-03-04 13:14:52 +01:00 committed by GitHub
parent 84bd136657
commit a58b1e9d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 19 deletions

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import {
getCustomizableShortcuts,
getKeyboardShortcutsForUI,
getKeyboardShortcuts,
KEYBOARD_SHORTCUTS,
mock,
@ -35,10 +35,10 @@ describe("KeyboardShortcuts", () => {
PlatformPeg.get = () => ({ overrideBrowserShortcuts: () => false });
const copyKeyboardShortcuts = Object.assign({}, KEYBOARD_SHORTCUTS);
getCustomizableShortcuts();
expect(KEYBOARD_SHORTCUTS).toEqual(copyKeyboardShortcuts);
getKeyboardShortcuts();
expect(KEYBOARD_SHORTCUTS).toEqual(copyKeyboardShortcuts);
getKeyboardShortcutsForUI();
expect(KEYBOARD_SHORTCUTS).toEqual(copyKeyboardShortcuts);
});
it("correctly filters shortcuts", async () => {
@ -54,7 +54,7 @@ describe("KeyboardShortcuts", () => {
});
PlatformPeg.get = () => ({ overrideBrowserShortcuts: () => false });
expect(getCustomizableShortcuts()).toEqual({ "Keybind4": {} });
expect(getKeyboardShortcuts()).toEqual({ "Keybind4": {} });
mock({
keyboardShortcuts: {
@ -65,7 +65,7 @@ describe("KeyboardShortcuts", () => {
desktopShortcuts: ["Keybind2"],
});
PlatformPeg.get = () => ({ overrideBrowserShortcuts: () => true });
expect(getCustomizableShortcuts()).toEqual({ "Keybind1": {}, "Keybind2": {} });
expect(getKeyboardShortcuts()).toEqual({ "Keybind1": {}, "Keybind2": {} });
jest.resetModules();
});
});