run prettier
This commit is contained in:
parent
51aa9d799c
commit
d5717f2307
1 changed files with 32 additions and 30 deletions
|
|
@ -1221,39 +1221,41 @@ test('collapse canonicalization is not affected by previous calls', { timeout },
|
|||
])
|
||||
})
|
||||
|
||||
test('collapse does not crash when utilities with no standard properties are present', { timeout }, async () => {
|
||||
let designSystem = await designSystems.get(__dirname).get(css`
|
||||
@import 'tailwindcss';
|
||||
`)
|
||||
test(
|
||||
'collapse does not crash when utilities with no standard properties are present',
|
||||
{ timeout },
|
||||
async () => {
|
||||
let designSystem = await designSystems.get(__dirname).get(css`
|
||||
@import 'tailwindcss';
|
||||
`)
|
||||
|
||||
let options: CanonicalizeOptions = {
|
||||
collapse: true,
|
||||
logicalToPhysical: true,
|
||||
rem: 16,
|
||||
}
|
||||
let options: CanonicalizeOptions = {
|
||||
collapse: true,
|
||||
logicalToPhysical: true,
|
||||
rem: 16,
|
||||
}
|
||||
|
||||
// Shadow utilities use CSS custom properties and @property rules but may
|
||||
// produce empty property maps in the collapse algorithm. This should not
|
||||
// crash with "Cannot read properties of null" or "X is not iterable".
|
||||
expect(() =>
|
||||
designSystem.canonicalizeCandidates(['shadow-sm', 'border'], options),
|
||||
).not.toThrow()
|
||||
// Shadow utilities use CSS custom properties and @property rules but may
|
||||
// produce empty property maps in the collapse algorithm. This should not
|
||||
// crash with "Cannot read properties of null" or "X is not iterable".
|
||||
expect(() =>
|
||||
designSystem.canonicalizeCandidates(['shadow-sm', 'border'], options),
|
||||
).not.toThrow()
|
||||
|
||||
expect(() =>
|
||||
designSystem.canonicalizeCandidates(['shadow-md', 'p-4'], options),
|
||||
).not.toThrow()
|
||||
expect(() => designSystem.canonicalizeCandidates(['shadow-md', 'p-4'], options)).not.toThrow()
|
||||
|
||||
expect(() =>
|
||||
designSystem.canonicalizeCandidates(['shadow-sm', 'shadow-md'], options),
|
||||
).not.toThrow()
|
||||
expect(() =>
|
||||
designSystem.canonicalizeCandidates(['shadow-sm', 'shadow-md'], options),
|
||||
).not.toThrow()
|
||||
|
||||
// Verify the candidates are returned (not collapsed, since shadows can't
|
||||
// meaningfully collapse with unrelated utilities)
|
||||
expect(
|
||||
designSystem.canonicalizeCandidates(['shadow-sm', 'border'], options),
|
||||
).toEqual(expect.arrayContaining(['shadow-sm', 'border']))
|
||||
// Verify the candidates are returned (not collapsed, since shadows can't
|
||||
// meaningfully collapse with unrelated utilities)
|
||||
expect(designSystem.canonicalizeCandidates(['shadow-sm', 'border'], options)).toEqual(
|
||||
expect.arrayContaining(['shadow-sm', 'border']),
|
||||
)
|
||||
|
||||
expect(
|
||||
designSystem.canonicalizeCandidates(['shadow-sm', 'shadow-md'], options),
|
||||
).toEqual(expect.arrayContaining(['shadow-sm', 'shadow-md']))
|
||||
})
|
||||
expect(designSystem.canonicalizeCandidates(['shadow-sm', 'shadow-md'], options)).toEqual(
|
||||
expect.arrayContaining(['shadow-sm', 'shadow-md']),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue