element-call-Github/src/initializer.test.ts

29 lines
767 B
TypeScript
Raw Normal View History

/*
Copyright 2022-2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
import { expect, test } from "vitest";
import { Initializer } from "../src/initializer";
test("initBeforeReact sets font family from URL param", () => {
window.location.hash = "#?font=DejaVu Sans";
Initializer.initBeforeReact();
expect(
2023-10-11 22:42:04 +08:00
getComputedStyle(document.documentElement).getPropertyValue(
"--font-family",
),
).toBe('"DejaVu Sans"');
});
test("initBeforeReact sets font scale from URL param", () => {
window.location.hash = "#?fontScale=1.2";
Initializer.initBeforeReact();
expect(
2023-10-11 22:42:04 +08:00
getComputedStyle(document.documentElement).getPropertyValue("--font-scale"),
).toBe("1.2");
});