You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
import {
|
||||
CATEGORIES,
|
||||
CategoryName,
|
||||
KEYBOARD_SHORTCUTS,
|
||||
getKeyboardShortcuts,
|
||||
registerShortcut,
|
||||
} from "../../src/accessibility/KeyboardShortcuts";
|
||||
import { Key } from "../../src/Keyboard";
|
||||
@@ -38,7 +38,7 @@ describe("KeyboardShortcuts", () => {
|
||||
|
||||
registerShortcut(shortcutName, shortcutCategory, shortcut);
|
||||
|
||||
expect(KEYBOARD_SHORTCUTS[shortcutName]).toBe(shortcut);
|
||||
expect(getKeyboardShortcuts()[shortcutName]).toBe(shortcut);
|
||||
expect(CATEGORIES[shortcutCategory].settingNames.includes(shortcutName)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
@@ -60,7 +60,7 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
|
||||
it("doesn't render same modifier twice", async () => {
|
||||
mockKeyboardShortcuts({
|
||||
"KEYBOARD_SHORTCUTS": {
|
||||
"getKeyboardShortcuts": () => ({
|
||||
"keybind1": {
|
||||
default: {
|
||||
key: Key.A,
|
||||
@@ -69,14 +69,14 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
},
|
||||
displayName: "Cancel replying to a message",
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
const body1 = await renderKeyboardUserSettingsTab("KeyboardShortcut", { name: "keybind1" });
|
||||
expect(body1).toMatchSnapshot();
|
||||
jest.resetModules();
|
||||
|
||||
mockKeyboardShortcuts({
|
||||
"KEYBOARD_SHORTCUTS": {
|
||||
"getKeyboardShortcuts": () => ({
|
||||
"keybind1": {
|
||||
default: {
|
||||
key: Key.A,
|
||||
@@ -85,7 +85,7 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
},
|
||||
displayName: "Cancel replying to a message",
|
||||
},
|
||||
},
|
||||
}),
|
||||
});
|
||||
const body2 = await renderKeyboardUserSettingsTab("KeyboardShortcut", { name: "keybind1" });
|
||||
expect(body2).toMatchSnapshot();
|
||||
@@ -94,7 +94,7 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
|
||||
it("renders list of keyboard shortcuts", async () => {
|
||||
mockKeyboardShortcuts({
|
||||
"KEYBOARD_SHORTCUTS": {
|
||||
"getKeyboardShortcuts": () => ({
|
||||
"keybind1": {
|
||||
default: {
|
||||
key: Key.A,
|
||||
@@ -115,7 +115,7 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
},
|
||||
displayName: "Select room from the room list",
|
||||
},
|
||||
},
|
||||
}),
|
||||
"CATEGORIES": {
|
||||
"Composer": {
|
||||
settingNames: ["keybind1", "keybind2"],
|
||||
|
Reference in New Issue
Block a user