1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Unit test tsc fixes part 15 (#8104)

* fix ts issues in MPollBody test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix ts issues in PollCreateDialog

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix settings components

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix DateSeparator

Signed-off-by: Kerry Archibald <kerrya@element.io>

* fix loosies

Signed-off-by: Kerry Archibald <kerrya@element.io>

* update tsconfig

Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
Kerry
2022-03-22 11:32:35 +01:00
committed by GitHub
parent 2bf1d2b287
commit abc225d3c6
16 changed files with 2663 additions and 3038 deletions

View File

@@ -19,7 +19,7 @@ import React from "react";
import { mount, ReactWrapper } from "enzyme";
import { Key } from "../../../../src/Keyboard";
import PlatformPeg from "../../../../src/PlatformPeg";
import { mockPlatformPeg, unmockPlatformPeg } from "../../../test-utils/platform";
const PATH_TO_COMPONENT = "../../../../src/components/views/settings/KeyboardShortcut.tsx";
@@ -31,6 +31,7 @@ const renderKeyboardShortcut = async (component, props?): Promise<ReactWrapper>
describe("KeyboardShortcut", () => {
beforeEach(() => {
jest.resetModules();
unmockPlatformPeg();
});
it("renders key icon", async () => {
@@ -49,7 +50,7 @@ describe("KeyboardShortcut", () => {
});
it("doesn't render same modifier twice", async () => {
PlatformPeg.get = () => ({ overrideBrowserShortcuts: () => false });
mockPlatformPeg({ overrideBrowserShortcuts: jest.fn().mockReturnValue(false) });
const body1 = await renderKeyboardShortcut("KeyboardShortcut", {
value: {
key: Key.A,