Skip to content

Commit 559bc02

Browse files
committed
Add test
1 parent c4cb67f commit 559bc02

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/tailwindcss/src/intellisense.test.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ test('Theme keys with underscores are suggested with underscores', async () => {
579579
/* This will get suggeted with an underscore */
580580
--spacing-logo_margin: 0.875rem;
581581
}
582+
583+
@utility ex-* {
584+
width: --value(--spacing- *);
585+
}
582586
`
583587

584588
let design = await __unstable__loadDesignSystem(input, {
@@ -588,13 +592,23 @@ test('Theme keys with underscores are suggested with underscores', async () => {
588592
}),
589593
})
590594

591-
let entries = design.getClassList().filter(([name]) => name.startsWith('p-'))
595+
let entries = design
596+
.getClassList()
597+
.filter(([name]) => name.startsWith('p-') || name.startsWith('ex-'))
592598

593599
expect(entries).toContainEqual(['p-1.5', { modifiers: [] }])
594600
expect(entries).toContainEqual(['p-2.5', { modifiers: [] }])
595601
expect(entries).toContainEqual(['p-logo_margin', { modifiers: [] }])
596602

603+
expect(entries).toContainEqual(['ex-1.5', { modifiers: [] }])
604+
expect(entries).toContainEqual(['ex-2.5', { modifiers: [] }])
605+
expect(entries).toContainEqual(['ex-logo_margin', { modifiers: [] }])
606+
597607
expect(entries).not.toContainEqual(['p-1_5', { modifiers: [] }])
598608
expect(entries).not.toContainEqual(['p-2_5', { modifiers: [] }])
599609
expect(entries).not.toContainEqual(['p-logo.margin', { modifiers: [] }])
610+
611+
expect(entries).not.toContainEqual(['ex-1_5', { modifiers: [] }])
612+
expect(entries).not.toContainEqual(['ex-2_5', { modifiers: [] }])
613+
expect(entries).not.toContainEqual(['ex-logo.margin', { modifiers: [] }])
600614
})

0 commit comments

Comments
 (0)