import { describe, expect, it } from 'vitest';
import { cn } from './utils';

describe('cn', () => {
  it('merges class names', () => {
    expect(cn('flex', 'items-center')).toBe('flex items-center');
  });

  it('resolves conflicting tailwind classes in favor of the last one', () => {
    expect(cn('px-2', 'px-4')).toBe('px-4');
  });

  it('drops falsy values', () => {
    expect(cn('base', false && 'hidden', undefined, null, 'visible')).toBe('base visible');
  });
});
