1 import clsx from './clsx';
3 describe('clsx()', () => {
4 it('handles array arguments', () => {
5 const result = clsx(['a', 'b']);
7 expect(result).toBe('a b');
10 it('returns empty string when empty array is passed', () => {
11 const result = clsx([]);
13 expect(result).toBe('');
16 it('returns empty string when empty string is passed', () => {
17 const result = clsx('');
19 expect(result).toBe('');
22 it('joins strings correctly', () => {
23 const result = clsx('a', 'b');
25 expect(result).toBe('a b');
28 it('trims empty space', () => {
29 const result = clsx('foo bar', ' ', 'foobar');
31 expect(result).toBe('foo bar foobar');
34 it('keeps only non-blank strings', () => {
35 const result = clsx(null, '', false, undefined, 'foobar', ' ', true);
37 expect(result).toBe('foobar');