You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Comply with noImplicitAny (#9940)
* Stash noImplicitAny work * Stash * Fix imports * Iterate * Fix tests * Delint * Fix tests
This commit is contained in:
committed by
GitHub
parent
ac7f69216e
commit
61a63e47f4
@ -18,33 +18,29 @@ import { setTheme } from "../src/theme";
|
||||
|
||||
describe("theme", () => {
|
||||
describe("setTheme", () => {
|
||||
let lightTheme;
|
||||
let darkTheme;
|
||||
let lightTheme: HTMLStyleElement;
|
||||
let darkTheme: HTMLStyleElement;
|
||||
|
||||
let spyQuerySelectorAll: jest.MockInstance<NodeListOf<Element>, [selectors: string]>;
|
||||
|
||||
beforeEach(() => {
|
||||
const styles = [
|
||||
{
|
||||
attributes: {
|
||||
"data-mx-theme": {
|
||||
value: "light",
|
||||
},
|
||||
dataset: {
|
||||
mxTheme: "light",
|
||||
},
|
||||
disabled: true,
|
||||
href: "urlLight",
|
||||
onload: () => void 0,
|
||||
},
|
||||
onload: (): void => void 0,
|
||||
} as unknown as HTMLStyleElement,
|
||||
{
|
||||
attributes: {
|
||||
"data-mx-theme": {
|
||||
value: "dark",
|
||||
},
|
||||
dataset: {
|
||||
mxTheme: "dark",
|
||||
},
|
||||
disabled: true,
|
||||
href: "urlDark",
|
||||
onload: () => void 0,
|
||||
},
|
||||
onload: (): void => void 0,
|
||||
} as unknown as HTMLStyleElement,
|
||||
];
|
||||
lightTheme = styles[0];
|
||||
darkTheme = styles[1];
|
||||
@ -62,7 +58,7 @@ describe("theme", () => {
|
||||
// When
|
||||
await new Promise((resolve) => {
|
||||
setTheme("light").then(resolve);
|
||||
lightTheme.onload();
|
||||
lightTheme.onload(void 0);
|
||||
});
|
||||
|
||||
// Then
|
||||
|
Reference in New Issue
Block a user