Skip to content

Commit

Permalink
add failing test for the apply of group-hover in a nested structure
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Aug 28, 2020
1 parent de2e71b commit f655aee
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions __tests__/applyComplexClasses.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1094,3 +1094,46 @@ test('you can deeply apply classes in a custom nested @atrule', () => {
expect(result.warnings().length).toBe(0)
})
})

test('you can apply complex utilities deeply nested', () => {
const input = `
.foo {
.bar {
.baz {
@apply group-hover:opacity-50 hover:font-bold;
}
}
}
.group:hover .group-hover\\:opacity-50 {
opacity: .5;
}
`

const expected = `
.group\:hover .foo {
.bar {
.baz {
opacity: .5;
}
}
}
.foo {
.bar {
.baz:hover {
font-weight: 700;
}
}
}
.group:hover .group-hover\\:opacity-50 {
opacity: .5;
}
`

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

0 comments on commit f655aee

Please sign in to comment.