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>
28 lines
741 B
TypeScript
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');
|
|
});
|
|
});
|