Skip to content

Commit 8839dd3

Browse files
committed
Add tests
1 parent bbfde54 commit 8839dd3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

packages/tailwindcss/src/candidate.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,3 +1790,31 @@ it.each([
17901790

17911791
expect(run(rawCandidate, { utilities, variants })).toEqual([])
17921792
})
1793+
1794+
it.each([
1795+
// Arbitrary properties with `;` or `}`
1796+
'[color:red;color:blue]',
1797+
'[color:red}html{color:blue]',
1798+
1799+
// Arbitrary values that end the declaration
1800+
'bg-[red;color:blue]',
1801+
1802+
// Arbitrary values that end the block
1803+
'bg-[red}html{color:blue]',
1804+
1805+
// Arbitrary variants that end the block
1806+
'[&{color:red}]:flex',
1807+
1808+
// Arbitrary variant values that end the block
1809+
'data-[a]{color:red}foo[a]:flex',
1810+
])('should not parse invalid arbitrary values: %s', (rawCandidate) => {
1811+
let utilities = new Utilities()
1812+
utilities.static('flex', () => [])
1813+
utilities.functional('bg', () => [])
1814+
1815+
let variants = new Variants()
1816+
variants.functional('data', () => {})
1817+
variants.compound('group', Compounds.StyleRules, () => {})
1818+
1819+
expect(run(rawCandidate, { utilities, variants })).toEqual([])
1820+
})

0 commit comments

Comments
 (0)