Skip to content

Commit

Permalink
Split tests for at-rule and at-rule with selector changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed May 8, 2022
1 parent 3236eb9 commit 00a79e6
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions tests/arbitrary-variants.test.js
Expand Up @@ -135,7 +135,7 @@ test('using the important modifier', () => {

test('at-rules', () => {
let config = {
content: [{ raw: html`<div class="[@supports_(what:ever){&:hover}]:underline"></div>` }],
content: [{ raw: html`<div class="[@supports_(what:ever)]:underline"></div>` }],
corePlugins: { preflight: false },
}

Expand All @@ -150,7 +150,32 @@ test('at-rules', () => {
${defaults}
@supports (what: ever) {
.\[\@supports_\(what\:ever\)\{\&\:hover\}\]\:underline:hover {
.\[\@supports_\(what\:ever\)\]\:underline {
text-decoration-line: underline;
}
}
`)
})
})

test('at-rules with selector modifications', () => {
let config = {
content: [{ raw: html`<div class="[@media_(hover:hover){&:hover}]:underline"></div>` }],
corePlugins: { preflight: false },
}

let input = css`
@tailwind base;
@tailwind components;
@tailwind utilities;
`

return run(input, config).then((result) => {
expect(result.css).toMatchFormattedCss(css`
${defaults}
@media (hover: hover) {
.\[\@media_\(hover\:hover\)\{\&\:hover\}\]\:underline:hover {
text-decoration-line: underline;
}
}
Expand Down

0 comments on commit 00a79e6

Please sign in to comment.