mirror of
https://github.com/melgarafael/DeskcommCRM.git
synced 2026-10-02 01:28:34 +08:00
- playwright.config.ts + tests/e2e/smoke.spec.ts (status 200 + zero console errors) - vitest.config.ts + tests/setup/vitest.setup.ts (jsdom, @ alias) - Unit tests covering whole EPIC-00: - lib/utils (cn) - lib/query/client (canonical defaults) - lib/ui/icons (>=20 exports) - lib/api/client (idempotency, request-id, 422 ApiError, 500 no-retry, override) - lib/schemas/_validate (valid, invalid, body_malformed, requestId) - components/feedback/ApiErrorToast (map, fallbacks) Implements S-00.07 contract: infra.test-runner. Seeds regression suite for EPIC-00. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
489 B
TypeScript
21 lines
489 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
describe("cn()", () => {
|
|
it("merges plain strings", () => {
|
|
expect(cn("a", "b")).toBe("a b");
|
|
});
|
|
|
|
it("drops falsy conditional values", () => {
|
|
expect(cn("a", false && "b", "c")).toBe("a c");
|
|
});
|
|
|
|
it("flattens arrays", () => {
|
|
expect(cn(["a", "b"], "c")).toBe("a b c");
|
|
});
|
|
|
|
it("ignores undefined and null", () => {
|
|
expect(cn("a", undefined, null, "b")).toBe("a b");
|
|
});
|
|
});
|