move failing test to dedicated failing test

This commit is contained in:
Robin Malfait 2023-10-02 16:58:54 +02:00 • committed by depfu[bot]
parent 1879130f45
commit 82e0acebe0
3 changed files with 29 additions and 14 deletions

View file

@ -175,16 +175,6 @@
.w-\[var\(--width\,calc\(100\%\+1rem\)\)\] {
width: var(--width, calc(100% + 1rem));
}
.w-\[\{\{\}\}\] {
width: {
{
}
}
}
.w-\[\{\}\] {
width: {
}
}
.min-w-\[3\.23rem\] {
min-width: 3.23rem;
}

View file

@ -368,10 +368,6 @@
<!-- INVALID -->
<div class="grid-cols-[[linename],1fr,auto]"></div>
<!-- VALID -->
<div class="w-[{}]"></div>
<!-- VALID -->
<div class="w-[{{}}]"></div>
<!-- VALID -->
<div class="w-[[]]"></div>
<!-- VALID -->
<div class="w-[[[]]]"></div>

View file

@ -14,6 +14,35 @@ test('arbitrary values', () => {
})
})
// TODO: Currently Lightning CSS will throw an error when trying to print the invalid CSS, whereas
// before it generated invalid CSS without throwing an error.
//
// In perfect world, we would not generate anything, and potentially show a warning.
test.skip('arbitrary values that result in invalid CSS should not be generated', () => {
let config = {
content: [
{
raw: html`<div class="w-[{}] w-[{{}}]"></div>`,
},
],
}
return run('@tailwind utilities', config).then((result) => {
return expect(result.css).toMatchFormattedCss(css`
.w-\[\{\{\}\}\] {
width: {
{
}
}
}
.w-\[\{\}\] {
width: {
}
}
`)
})
})
test('should only detect classes with arbitrary values that are properly terminated after the arbitrary value', () => {
let config = {
content: [