import { describe, it, expect } from 'vitest'; import { cn } from '../utils'; describe('cn', () => { it('should merge class names', () => { expect(cn('foo', 'bar')).toBe('foo bar'); }); it('should handle conditional classes', () => { const isHidden = false; expect(cn('base', isHidden && 'hidden', 'visible')).toBe('base visible'); }); it('should merge conflicting Tailwind classes', () => { expect(cn('px-4', 'px-6')).toBe('px-6'); expect(cn('text-red-500', 'text-blue-500')).toBe('text-blue-500'); }); it('should handle empty inputs', () => { expect(cn()).toBe(''); expect(cn('')).toBe(''); }); it('should handle arrays', () => { expect(cn(['foo', 'bar'])).toBe('foo bar'); }); });