From c678d91fe031dce45d5bb6182f58377940fb397d Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Mon, 4 Jun 2018 08:49:36 -0400 Subject: [PATCH] Test that class names in apply directives are escaped --- __tests__/applyAtRule.test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/__tests__/applyAtRule.test.js b/__tests__/applyAtRule.test.js index 44673d3d8..386925afa 100644 --- a/__tests__/applyAtRule.test.js +++ b/__tests__/applyAtRule.test.js @@ -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; }