Skip to content

Commit

Permalink
add test to verify that apply on multiple selectors work
Browse files Browse the repository at this point in the history
Fixes: #2906
  • Loading branch information
RobinMalfait committed Nov 26, 2020
1 parent 1522029 commit b97e5b2
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions __tests__/applyAtRule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,43 @@ test('you can apply classes to a rule with multiple selectors with important and
})
})

test('you can apply classes to multiple selectors at the same time, removing important', () => {
const input = `
.multiple p,
.multiple ul,
.multiple ol {
@apply mt-5;
}
.multiple h2,
.multiple h3,
.multiple h4 {
@apply mt-8;
}
`

const expected = `
.multiple p,
.multiple ul,
.multiple ol {
margin-top: 1.25rem;
}
.multiple h2,
.multiple h3,
.multiple h4 {
margin-top: 2rem;
}
`

const config = resolveConfig([{...defaultConfig, important: true}])

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

test('you can apply classes in a nested rule', () => {
const input = `
.selector {
Expand Down

0 comments on commit b97e5b2

Please sign in to comment.