From 6a41c0d73e5b6e7f03ae359727386b1b566fde8a Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 26 Nov 2020 16:12:47 +0100 Subject: [PATCH] add test to verify that apply on multiple selectors work Fixes: #2906 --- __tests__/applyAtRule.test.js | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/__tests__/applyAtRule.test.js b/__tests__/applyAtRule.test.js index df8da5bf3..13f7b8ef9 100644 --- a/__tests__/applyAtRule.test.js +++ b/__tests__/applyAtRule.test.js @@ -1179,6 +1179,43 @@ test('you can apply classes to a rule with multiple selectors with important and }) }) +test('you can apply classes to multiple selectors at the same time, removing important', () => { + const input = ` + .multiple p, + .multiple ul, + .multiple ol { + @apply mt-5; + } + + .multiple h2, + .multiple h3, + .multiple h4 { + @apply mt-8; + } + ` + + const expected = ` + .multiple p, + .multiple ul, + .multiple ol { + margin-top: 1.25rem; + } + + .multiple h2, + .multiple h3, + .multiple h4 { + margin-top: 2rem; + } + ` + + const config = resolveConfig([{ ...defaultConfig, important: true }]) + + return run(input, config).then((result) => { + expect(result.css).toMatchCss(expected) + expect(result.warnings().length).toBe(0) + }) +}) + test('you can apply classes in a nested rule', () => { const input = ` .selector {