You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Don't change KEYBOARD_SHORTCUTS
and do some refactoring (#7818)
This commit is contained in:
@ -17,13 +17,24 @@ limitations under the License.
|
||||
import {
|
||||
CATEGORIES,
|
||||
CategoryName,
|
||||
getCustomizableShortcuts,
|
||||
getKeyboardShortcuts,
|
||||
KEYBOARD_SHORTCUTS,
|
||||
registerShortcut,
|
||||
} from "../../src/accessibility/KeyboardShortcuts";
|
||||
import { Key } from "../../src/Keyboard";
|
||||
import { ISetting } from "../../src/settings/Settings";
|
||||
|
||||
describe("KeyboardShortcuts", () => {
|
||||
it("doesn't change KEYBOARD_SHORTCUTS when getting shortcuts", () => {
|
||||
const copyKeyboardShortcuts = Object.assign({}, KEYBOARD_SHORTCUTS);
|
||||
|
||||
getCustomizableShortcuts();
|
||||
expect(KEYBOARD_SHORTCUTS).toEqual(copyKeyboardShortcuts);
|
||||
getKeyboardShortcuts();
|
||||
expect(KEYBOARD_SHORTCUTS).toEqual(copyKeyboardShortcuts);
|
||||
});
|
||||
|
||||
describe("registerShortcut()", () => {
|
||||
it("correctly registers shortcut", () => {
|
||||
const shortcutName = "Keybinding.definitelyARealShortcut";
|
||||
|
Reference in New Issue
Block a user