PettyUI/packages/registry/tests/utils.test.ts
Mats Bosson b4ec99fe4a Registry package scaffold
Adds the shadcn-style copy-paste layer as a new monorepo package. Includes
theme token CSS custom properties (light/dark), a cn() class-merging utility
with tests, and a reference Dialog styled component wrapping the headless
pettyui/dialog primitive with Tailwind classes.
2026-03-29 20:53:40 +07:00

15 lines
402 B
TypeScript

import { describe, expect, it } from "vitest";
import { cn } from "../src/utils";
describe("cn utility", () => {
it("joins class names", () => {
expect(cn("foo", "bar")).toBe("foo bar");
});
it("filters falsy values", () => {
expect(cn("foo", undefined, null, false, "bar")).toBe("foo bar");
});
it("returns empty string for no classes", () => {
expect(cn()).toBe("");
});
});