Include /test in tsc config, fix rest of issues (#8119)
* fix ts issue in PosthogAnalytics test Signed-off-by: Kerry Archibald <kerrya@element.io> * fix remaining ts issues Signed-off-by: Kerry Archibald <kerrya@element.io> * tsconfig change Signed-off-by: Kerry Archibald <kerrya@element.io> * use sdkconfig patch instead of put Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
752ad6a9f9
commit
a8d65ab5c5
8 changed files with 63 additions and 65 deletions
|
@ -19,9 +19,13 @@ import {
|
|||
mock,
|
||||
} from "../../src/accessibility/KeyboardShortcuts";
|
||||
import { getKeyboardShortcuts, getKeyboardShortcutsForUI } from "../../src/accessibility/KeyboardShortcutUtils";
|
||||
import PlatformPeg from "../../src/PlatformPeg";
|
||||
import { mockPlatformPeg, unmockPlatformPeg } from "../test-utils";
|
||||
|
||||
describe("KeyboardShortcutUtils", () => {
|
||||
afterEach(() => {
|
||||
unmockPlatformPeg();
|
||||
});
|
||||
|
||||
it("doesn't change KEYBOARD_SHORTCUTS when getting shortcuts", async () => {
|
||||
mock({
|
||||
keyboardShortcuts: {
|
||||
|
@ -31,7 +35,7 @@ describe("KeyboardShortcutUtils", () => {
|
|||
macOnlyShortcuts: ["Keybind1"],
|
||||
desktopShortcuts: ["Keybind2"],
|
||||
});
|
||||
PlatformPeg.get = () => ({ overrideBrowserShortcuts: () => false });
|
||||
mockPlatformPeg({ overrideBrowserShortcuts: jest.fn().mockReturnValue(false) });
|
||||
const copyKeyboardShortcuts = Object.assign({}, KEYBOARD_SHORTCUTS);
|
||||
|
||||
getKeyboardShortcuts();
|
||||
|
@ -52,7 +56,7 @@ describe("KeyboardShortcutUtils", () => {
|
|||
desktopShortcuts: ["Keybind2"],
|
||||
|
||||
});
|
||||
PlatformPeg.get = () => ({ overrideBrowserShortcuts: () => false });
|
||||
mockPlatformPeg({ overrideBrowserShortcuts: jest.fn().mockReturnValue(false) });
|
||||
expect(getKeyboardShortcuts()).toEqual({ "Keybind4": {} });
|
||||
|
||||
mock({
|
||||
|
@ -63,8 +67,7 @@ describe("KeyboardShortcutUtils", () => {
|
|||
macOnlyShortcuts: undefined,
|
||||
desktopShortcuts: ["Keybind2"],
|
||||
});
|
||||
PlatformPeg.get = () => ({ overrideBrowserShortcuts: () => true });
|
||||
mockPlatformPeg({ overrideBrowserShortcuts: jest.fn().mockReturnValue(true) });
|
||||
expect(getKeyboardShortcuts()).toEqual({ "Keybind1": {}, "Keybind2": {} });
|
||||
jest.resetModules();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -108,7 +108,10 @@ describe("RovingTabIndex", () => {
|
|||
{ button2 }
|
||||
<RovingTabIndexWrapper>
|
||||
{ ({ onFocus, isActive, ref }) =>
|
||||
<button onFocus={onFocus} tabIndex={isActive ? 0 : -1} ref={ref}>.</button>
|
||||
<button
|
||||
onFocus={onFocus}
|
||||
tabIndex={isActive ? 0 : -1}
|
||||
ref={ref as React.RefObject<HTMLButtonElement>}>.</button>
|
||||
}
|
||||
</RovingTabIndexWrapper>
|
||||
</React.Fragment> }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue