Skip to content

Commit 82e0ace

Browse files
RobinMalfaitdepfu[bot]
authored andcommitted
move failing test to dedicated failing test
1 parent 1879130 commit 82e0ace

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

tests/arbitrary-values.test.css

-10
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,6 @@
175175
.w-\[var\(--width\,calc\(100\%\+1rem\)\)\] {
176176
width: var(--width, calc(100% + 1rem));
177177
}
178-
.w-\[\{\{\}\}\] {
179-
width: {
180-
{
181-
}
182-
}
183-
}
184-
.w-\[\{\}\] {
185-
width: {
186-
}
187-
}
188178
.min-w-\[3\.23rem\] {
189179
min-width: 3.23rem;
190180
}

tests/arbitrary-values.test.html

-4
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@
368368
<!-- INVALID -->
369369
<div class="grid-cols-[[linename],1fr,auto]"></div>
370370
<!-- VALID -->
371-
<div class="w-[{}]"></div>
372-
<!-- VALID -->
373-
<div class="w-[{{}}]"></div>
374-
<!-- VALID -->
375371
<div class="w-[[]]"></div>
376372
<!-- VALID -->
377373
<div class="w-[[[]]]"></div>

tests/arbitrary-values.test.js

+29
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,35 @@ test('arbitrary values', () => {
1414
})
1515
})
1616

17+
// TODO: Currently Lightning CSS will throw an error when trying to print the invalid CSS, whereas
18+
// before it generated invalid CSS without throwing an error.
19+
//
20+
// In perfect world, we would not generate anything, and potentially show a warning.
21+
test.skip('arbitrary values that result in invalid CSS should not be generated', () => {
22+
let config = {
23+
content: [
24+
{
25+
raw: html`<div class="w-[{}] w-[{{}}]"></div>`,
26+
},
27+
],
28+
}
29+
30+
return run('@tailwind utilities', config).then((result) => {
31+
return expect(result.css).toMatchFormattedCss(css`
32+
.w-\[\{\{\}\}\] {
33+
width: {
34+
{
35+
}
36+
}
37+
}
38+
.w-\[\{\}\] {
39+
width: {
40+
}
41+
}
42+
`)
43+
})
44+
})
45+
1746
test('should only detect classes with arbitrary values that are properly terminated after the arbitrary value', () => {
1847
let config = {
1948
content: [

0 commit comments

Comments
 (0)