Skip to content

Commit 815d31d

Browse files
committed
add 'empty' variant test
confirm generated output
1 parent d552e20 commit 815d31d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

__tests__/variantsAtRule.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,27 @@ test('it can generate even variants', () => {
431431
})
432432
})
433433

434+
test('it can generate empty variants', () => {
435+
const input = `
436+
@variants empty {
437+
.banana { color: yellow; }
438+
.chocolate { color: brown; }
439+
}
440+
`
441+
442+
const output = `
443+
.banana { color: yellow; }
444+
.chocolate { color: brown; }
445+
.empty\\:banana:empty { color: yellow; }
446+
.empty\\:chocolate:empty { color: brown; }
447+
`
448+
449+
return run(input).then((result) => {
450+
expect(result.css).toMatchCss(output)
451+
expect(result.warnings().length).toBe(0)
452+
})
453+
})
454+
434455
test('it can generate group-hover variants', () => {
435456
const input = `
436457
@variants group-hover {

0 commit comments

Comments
 (0)