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
Document keyboard shortcuts (#7908)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
@@ -60,7 +60,7 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
|
||||
it("doesn't render same modifier twice", async () => {
|
||||
mockKeyboardShortcuts({
|
||||
"getKeyboardShortcuts": () => ({
|
||||
"getKeyboardShortcutsForUI": () => ({
|
||||
"keybind1": {
|
||||
default: {
|
||||
key: Key.A,
|
||||
@@ -76,7 +76,7 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
jest.resetModules();
|
||||
|
||||
mockKeyboardShortcuts({
|
||||
"getKeyboardShortcuts": () => ({
|
||||
"getKeyboardShortcutsForUI": () => ({
|
||||
"keybind1": {
|
||||
default: {
|
||||
key: Key.A,
|
||||
@@ -94,7 +94,7 @@ describe("KeyboardUserSettingsTab", () => {
|
||||
|
||||
it("renders list of keyboard shortcuts", async () => {
|
||||
mockKeyboardShortcuts({
|
||||
"getKeyboardShortcuts": () => ({
|
||||
"getKeyboardShortcutsForUI": () => ({
|
||||
"keybind1": {
|
||||
default: {
|
||||
key: Key.A,
|
||||
|
Reference in New Issue
Block a user