Skip to content

Commit

Permalink
Test that class names in apply directives are escaped
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Jun 4, 2018
1 parent 9b9d8f3 commit c678d91
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions __tests__/applyAtRule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ test("it copies a class's declarations into itself", () => {
})
})

test('selectors with invalid characters do not need to be manually escaped', () => {
const input = `
.a\\:1\\/2 { color: red; }
.b { @apply .a:1/2; }
`

const expected = `
.a\\:1\\/2 { color: red; }
.b { color: red; }
`

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

test('it removes important from applied classes by default', () => {
const input = `
.a { color: red !important; }
Expand Down

0 comments on commit c678d91

Please sign in to comment.