Skip to content

Commit 8706e3a

Browse files
author
Laurynas Grigutis
committed
feat: ensure same matches in a different spot are pushed to results in find.test.ts
1 parent 0977df1 commit 8706e3a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

packages/tailwindcss-language-service/src/util/find.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ test('classFunctions & classProperties should not duplicate matches', async ({ e
500500
lang: 'javascriptreact',
501501
settings: {
502502
tailwindCSS: {
503+
classAttributes: ['className'],
503504
classFunctions: ['cva', 'clsx'],
504505
},
505506
},
@@ -515,6 +516,17 @@ test('classFunctions & classProperties should not duplicate matches', async ({ e
515516
CONTENT
516517
</div>
517518
)
519+
const OtherComponent = ({ className }) => (
520+
<div
521+
className={clsx(
522+
'relative flex',
523+
'inset-0 md:h-[calc(100%-2rem)]',
524+
clsx('rounded-none bg-blue-700', className),
525+
)}
526+
>
527+
CONTENT
528+
</div>
529+
)
518530
`,
519531
})
520532

@@ -542,6 +554,27 @@ test('classFunctions & classProperties should not duplicate matches', async ({ e
542554
end: { line: 5, character: 36 },
543555
},
544556
},
557+
{
558+
classList: 'relative flex',
559+
range: {
560+
start: { line: 14, character: 7 },
561+
end: { line: 14, character: 20 },
562+
},
563+
},
564+
{
565+
classList: 'inset-0 md:h-[calc(100%-2rem)]',
566+
range: {
567+
start: { line: 15, character: 7 },
568+
end: { line: 15, character: 37 },
569+
},
570+
},
571+
{
572+
classList: 'rounded-none bg-blue-700',
573+
range: {
574+
start: { line: 16, character: 12 },
575+
end: { line: 16, character: 36 },
576+
},
577+
},
545578
])
546579
})
547580

0 commit comments

Comments
 (0)