mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
code: utils,nextjs,frontends (1 files)
This commit is contained in:
@@ -3,12 +3,13 @@ import { cn } from '@/lib/utils'
|
||||
|
||||
describe('utils', () => {
|
||||
describe('cn', () => {
|
||||
// Note: cn() uses clsx, which concatenates classes without smart Tailwind merging
|
||||
it.each([
|
||||
{
|
||||
input: ['px-2 py-1', 'px-3'],
|
||||
shouldContain: ['py-1', 'px-3'],
|
||||
shouldNotContain: ['px-2'],
|
||||
description: 'merge conflicting tailwind classes',
|
||||
shouldContain: ['px-2', 'py-1', 'px-3'],
|
||||
shouldNotContain: [] as string[],
|
||||
description: 'concatenate classes (no tailwind deduplication)',
|
||||
},
|
||||
{
|
||||
input: ['px-2', 'py-2'],
|
||||
@@ -24,9 +25,9 @@ describe('utils', () => {
|
||||
},
|
||||
{
|
||||
input: ['px-2 py-1 bg-red-500', 'px-3 bg-blue-500'],
|
||||
shouldContain: ['px-3', 'py-1', 'bg-blue-500'],
|
||||
shouldNotContain: ['px-2', 'bg-red-500'],
|
||||
description: 'merge tailwind classes with proper precedence',
|
||||
shouldContain: ['px-2', 'px-3', 'py-1', 'bg-red-500', 'bg-blue-500'],
|
||||
shouldNotContain: [] as string[],
|
||||
description: 'concatenate all classes (no tailwind deduplication)',
|
||||
},
|
||||
{
|
||||
input: ['px-2', undefined, null, 'py-1'],
|
||||
|
||||
Reference in New Issue
Block a user