Skip to content

Commit 2f5e2f2

Browse files
committed
Add failing test
1 parent 25539e3 commit 2f5e2f2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

packages/tailwindcss/src/intellisense.test.ts

+22
Original file line numberDiff line numberDiff line change
@@ -598,3 +598,25 @@ test('Theme keys with underscores are suggested with underscores', async () => {
598598
expect(entries).not.toContainEqual(['p-2_5', { modifiers: [] }])
599599
expect(entries).not.toContainEqual(['p-logo.margin', { modifiers: [] }])
600600
})
601+
602+
test('Custom @utility and existing utility with names matching theme keys dont give duplicate results', async () => {
603+
let input = css`
604+
@theme reference {
605+
--leading-sm: 0.25rem;
606+
--text-header: 1.5rem;
607+
}
608+
609+
@utility text-header {
610+
text-transform: uppercase;
611+
}
612+
`
613+
614+
let design = await __unstable__loadDesignSystem(input)
615+
616+
let classList = design.getClassList()
617+
let classMap = new Map(classList)
618+
let matches = classList.filter(([className]) => className === 'text-header')
619+
620+
expect(matches).toHaveLength(1)
621+
expect(classMap.get('text-header')?.modifiers).toEqual(['sm'])
622+
})

0 commit comments

Comments
 (0)