forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewport.test.ts
More file actions
23 lines (19 loc) · 740 Bytes
/
Copy pathviewport.test.ts
File metadata and controls
23 lines (19 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { readFileSync } from "node:fs";
import path from "node:path";
import { rootViewport, SURFACE_THEME_COLOR } from "./viewport";
const globalsCss = readFileSync(
path.resolve(process.cwd(), "src/app/globals.css"),
"utf8",
);
describe("root viewport", () => {
it("uses the surface token as theme-color", () => {
expect(globalsCss).toMatch(/--color-surface:\s*#f7f7f5/);
expect(SURFACE_THEME_COLOR).toBe("#f7f7f5");
expect(rootViewport.themeColor).toBe(SURFACE_THEME_COLOR);
});
it("declares a light color-scheme and device-width defaults", () => {
expect(rootViewport.colorScheme).toBe("light");
expect(rootViewport.width).toBe("device-width");
expect(rootViewport.initialScale).toBe(1);
});
});