2026-06-21 10:32:44 +08:00
|
|
|
import assert from "node:assert/strict";
|
|
|
|
|
import { readFile } from "node:fs/promises";
|
|
|
|
|
import { describe, it } from "node:test";
|
|
|
|
|
|
|
|
|
|
const source = await readFile(new URL("./site-header.tsx", import.meta.url), "utf8");
|
|
|
|
|
|
|
|
|
|
describe("site header preferences", () => {
|
2026-06-26 14:46:01 +08:00
|
|
|
it("renders palette and theme controls without a locale switcher", () => {
|
|
|
|
|
assert.doesNotMatch(source, /LocaleSwitcher/);
|
2026-06-21 10:32:44 +08:00
|
|
|
assert.match(source, /import \{ PaletteToggle \} from "@\/components\/palette-toggle"/);
|
|
|
|
|
assert.match(source, /import \{ ThemeToggle \} from "@\/components\/theme-toggle"/);
|
2026-06-26 14:46:01 +08:00
|
|
|
assert.match(source, /<PaletteToggle \/>[\s\S]*<ThemeToggle \/>/);
|
2026-06-21 10:32:44 +08:00
|
|
|
});
|
|
|
|
|
});
|