Skip to content

Commit

Permalink
add tests for touch classes
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Sep 18, 2023
1 parent e20a2d3 commit 9cf0c4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/class-map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ test('class map has correct class groups at first part', () => {
text: ['font-size', 'text-alignment', 'text-color', 'text-opacity', 'text-overflow'],
to: ['gradient-to', 'gradient-to-pos'],
top: ['top'],
touch: ['touch'],
touch: ['touch', 'touch-pz', 'touch-x', 'touch-y'],
tracking: ['tracking'],
transform: ['transform'],
transition: ['transition'],
Expand Down
13 changes: 13 additions & 0 deletions tests/conflicts-across-class-groups.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,16 @@ test('ring and shadow classes do not create conflict', () => {
expect(twMerge('shadow ring')).toBe('shadow ring')
expect(twMerge('shadow-md ring-2')).toBe('shadow-md ring-2')
})

test('touch classes do create conflicts correctly', () => {
expect(twMerge('touch-pan-x touch-pan-right')).toBe('touch-pan-right')
expect(twMerge('touch-none touch-pan-x')).toBe('touch-pan-x')
expect(twMerge('touch-pan-x touch-none')).toBe('touch-none')
expect(twMerge('touch-pan-x touch-pan-y touch-pinch-zoom')).toBe(
'touch-pan-x touch-pan-y touch-pinch-zoom',
)
expect(twMerge('touch-manipulation touch-pan-x touch-pan-y touch-pinch-zoom')).toBe(
'touch-pan-x touch-pan-y touch-pinch-zoom',
)
expect(twMerge('touch-pan-x touch-pan-y touch-pinch-zoom touch-auto')).toBe('touch-auto')
})

0 comments on commit 9cf0c4b

Please sign in to comment.