Files
goodgo-platform/apps/web/lib/__tests__/utils.spec.ts
Ho Ngoc Hai 8705a2d9a8 fix: resolve all ESLint errors across API and web packages
Fix 19+ lint errors: unused imports (Phone, DuplicateCandidate, listingDetailsSchema),
import ordering violations, consistent-type-imports, and constant binary expression
in test file.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-08 16:29:44 +07:00

28 lines
741 B
TypeScript

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');
});
});