deerflow2/frontend/src/styles/globals-brand-selectors.test.ts
MT-Mint 5d634e3ad1 test(brand): 覆盖新增品牌辅助函数和 CSS 选择器单测
新增 getBrandPrimaryColor / getBrandPrimaryColorWithAlpha / getInitialBrandFromBrowser / syncBrandClassName 的单元测试,以及 brand-default / brand-sxwz CSS 选择器存在性校验。
2026-06-12 11:39:05 +08:00

14 lines
518 B
TypeScript

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import path from "node:path";
import test from "node:test";
import url from "node:url";
const currentDir = path.dirname(url.fileURLToPath(import.meta.url));
const globalsCss = readFileSync(path.join(currentDir, "globals.css"), "utf8");
void test("brand selectors target :root to outrank default root variables", () => {
assert.match(globalsCss, /:root\.brand-default\s*\{/);
assert.match(globalsCss, /:root\.brand-sxwz\s*\{/);
});