Skip to content

Commit 660202a

Browse files
committed
add failing tests for #17974
1 parent ebeff4f commit 660202a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { __unstable__loadDesignSystem } from '@tailwindcss/node'
2-
import { expect, test } from 'vitest'
2+
import { expect, test, vi } from 'vitest'
3+
import * as versions from '../../utils/version'
34
import { migrateCandidate } from './migrate'
5+
vi.spyOn(versions, 'isMajor').mockReturnValue(true)
46

57
test('does not replace classes in invalid positions', async () => {
68
let designSystem = await __unstable__loadDesignSystem('@import "tailwindcss";', {
@@ -51,4 +53,9 @@ test('does not replace classes in invalid positions', async () => {
5153
await shouldNotReplace(`<Image placeholder="blur" src="/image.jpg" />`, 'blur')
5254
await shouldNotReplace(`<Image placeholder={'blur'} src="/image.jpg" />`, 'blur')
5355
await shouldNotReplace(`<Image placeholder={blur} src="/image.jpg" />`, 'blur')
56+
57+
// https://github.com/tailwindlabs/tailwindcss/issues/17974
58+
await shouldNotReplace('<div v-if="!duration">', '!duration')
59+
await shouldNotReplace('<div :active="!duration">', '!duration')
60+
await shouldNotReplace('<div :active="!visible">', '!visible')
5461
})

0 commit comments

Comments
 (0)