add test to verify that apply on multiple selectors work

Fixes: #2906
This commit is contained in:
Robin Malfait 2020-11-26 16:12:47 +01:00
parent 152202916c
commit 6a41c0d73e
No known key found for this signature in database
GPG Key ID: 92F53D68B9041AFE

View File

@ -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 {