Skip to content

Commit 57655e3

Browse files
committed
tests: Add more @at-rule test, some failing
1 parent 46829dc commit 57655e3

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

index.test.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,76 @@ test('nested at-root with nested media', () => {
136136
)
137137
})
138138

139+
test('tolerates immediately nested at-root', () => {
140+
run(
141+
`a {
142+
& {}
143+
@at-root {
144+
@at-root foo {
145+
c {}
146+
}
147+
}
148+
}`,
149+
`a {}
150+
foo c {}`
151+
)
152+
})
153+
154+
test('tolerates top-level at-root', () => {
155+
run(
156+
`@at-root {
157+
a {}
158+
}
159+
@media x {
160+
@at-root {
161+
b {}
162+
}
163+
}`,
164+
`a {}
165+
@media x {
166+
b {}
167+
}`
168+
)
169+
})
170+
171+
test('tolerates immediately nested at-root #2', () => {
172+
run(
173+
`@media x {
174+
a {
175+
& {}
176+
@at-root {
177+
@at-root (without: media) {
178+
c {}
179+
}
180+
}
181+
}
182+
}`,
183+
`@media x {
184+
a {}
185+
}
186+
c {}`
187+
)
188+
})
189+
190+
test('tolerates immediately nested at-root #3', () => {
191+
run(
192+
`@media x {
193+
a {
194+
& {}
195+
@at-root (without: media) {
196+
@at-root (without: media) {
197+
c {}
198+
}
199+
}
200+
}
201+
}`,
202+
`@media x {
203+
a {}
204+
}
205+
a c {}`
206+
)
207+
})
208+
139209
test('at-root supports (without: all)', () => {
140210
run(
141211
`@media x {

0 commit comments

Comments
 (0)