/* * ============================================================================= * VibeQuant (vquant) — AI-Powered Financial Intelligence Platform * ----------------------------------------------------------------------------- * File: client/src/lib/utils.test.ts * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * Website: https://www.spboucher.ai * Demo: https://www.vquant.ai * License: MIT (see LICENSE) * * Copyright © 2026 Simon-Pierre Boucher. All rights reserved. * ============================================================================= */ import { describe, it, expect } from "vitest"; import { cn } from "./utils"; describe("cn (className merge)", () => { it("merges class names", () => { expect(cn("px-2", "py-1")).toBe("px-2 py-1"); }); it("handles conditional classes", () => { const isHidden = false; expect(cn("base", isHidden && "hidden", "extra")).toBe("base extra"); }); it("deduplicates tailwind conflicts", () => { expect(cn("px-2", "px-4")).toBe("px-4"); }); it("handles empty inputs", () => { expect(cn()).toBe(""); }); it("handles undefined and null", () => { expect(cn("base", undefined, null)).toBe("base"); }); });