Skip to content

Commit

Permalink
add 'empty' variant test
Browse files Browse the repository at this point in the history
confirm generated output
  • Loading branch information
browner12 committed Jan 30, 2021
1 parent d552e20 commit 815d31d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions __tests__/variantsAtRule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,27 @@ test('it can generate even variants', () => {
})
})

test('it can generate empty variants', () => {
const input = `
@variants empty {
.banana { color: yellow; }
.chocolate { color: brown; }
}
`

const output = `
.banana { color: yellow; }
.chocolate { color: brown; }
.empty\\:banana:empty { color: yellow; }
.empty\\:chocolate:empty { color: brown; }
`

return run(input).then((result) => {
expect(result.css).toMatchCss(output)
expect(result.warnings().length).toBe(0)
})
})

test('it can generate group-hover variants', () => {
const input = `
@variants group-hover {
Expand Down

0 comments on commit 815d31d

Please sign in to comment.