Skip to content

Commit c678d91

Browse files
committed
Test that class names in apply directives are escaped
1 parent 9b9d8f3 commit c678d91

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

__tests__/applyAtRule.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ test("it copies a class's declarations into itself", () => {
1414
})
1515
})
1616

17+
test('selectors with invalid characters do not need to be manually escaped', () => {
18+
const input = `
19+
.a\\:1\\/2 { color: red; }
20+
.b { @apply .a:1/2; }
21+
`
22+
23+
const expected = `
24+
.a\\:1\\/2 { color: red; }
25+
.b { color: red; }
26+
`
27+
28+
return run(input).then(result => {
29+
expect(result.css).toEqual(expected)
30+
expect(result.warnings().length).toBe(0)
31+
})
32+
})
33+
1734
test('it removes important from applied classes by default', () => {
1835
const input = `
1936
.a { color: red !important; }

0 commit comments

Comments
 (0)