Skip to content

Add unit tests for lib/utils.ts's cn() edge cases: conflicting Tailwind class resolution #692

Description

@Austinaminu2

Description

Following up on the already-filed basic `cn()` test issue, add specific coverage for conflicting Tailwind class resolution (e.g. `cn('p-2', 'p-4')` should resolve to a single winning padding class), which is the trickiest and most bug-prone part of a class-merge helper.

Location

`lib/utils.ts:4`

Task

Add test cases specifically for conflicting utility classes of the same category (padding, margin, color, etc.), asserting the merge helper resolves them the same way `tailwind-merge` (or whatever underlying library is used) is documented to.

Good for contributors because

Narrow, well-defined edge case with clear expected behavior to assert against.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions