refactor(web): 界面工具 - 代码优化,替换重复的复制、打包、项目选择和主题切换实现
删除未再引用的文字扫光组件。复制提示、压缩包读写、项目多选和主题揭示的对外行为保持不变。
This commit is contained in:
17
web/test/m9-clean-room-ui.test.ts
Normal file
17
web/test/m9-clean-room-ui.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
describe("M9 clean-room utility contract", () => {
|
||||
test("keeps conditional class values", () => {
|
||||
expect(cn("root", false && "hidden", ["active", null], { selected: true, muted: false })).toBe("root active selected");
|
||||
});
|
||||
|
||||
test("lets tailwind-merge resolve conflicting utilities", () => {
|
||||
expect(cn("px-2", "px-6", "text-sm")).toBe("px-6 text-sm");
|
||||
});
|
||||
|
||||
test("returns an empty string when no class is enabled", () => {
|
||||
expect(cn(undefined, null, false)).toBe("");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user