From 694a1440a1ffce40065fe3560be58321f55ff468 Mon Sep 17 00:00:00 2001 From: Andreas Fahrecker Date: Thu, 3 Sep 2026 20:36:34 +0200 Subject: [PATCH] test: :white_check_mark: update v4 test expectations to match Tailwind's documented CSS flattening --- jest/plugin.test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/jest/plugin.test.js b/jest/plugin.test.js index b7dab17..1f6b11d 100644 --- a/jest/plugin.test.js +++ b/jest/plugin.test.js @@ -23,15 +23,15 @@ async function run(file, options = {}) { describe('import directive', () => { it('should add variants', async () => { expect(await run('content/variants.html', { directive: 'import' })).toIncludeAll([ - '.intersect\\:opacity-50 { &:not([no-intersect]) { opacity: 50%; } }', - '.intersect\\:hover\\:opacity-100 { &:not([no-intersect]) { &:hover { @media (hover: hover) { opacity: 100%; } } } }', + '.intersect\\:opacity-50:not([no-intersect]) { opacity: 50%; }', + '.intersect\\:hover\\:opacity-100:not([no-intersect]):hover { opacity: 100%; }', ]) }) it('should add arbitrary values', async () => { expect(await run('content/arbitrary-values.html', { directive: 'import' })).toIncludeAll([ - '.intersect\\:left-\\[100px\\] { &:not([no-intersect]) { left: 100px; } }', - '.intersect\\:left-\\(--my-value\\) { &:not([no-intersect]) { left: var(--my-value); } }', + '.intersect\\:left-\\[100px\\]:not([no-intersect]) { left: 100px; }', + '.intersect\\:left-\\(--my-value\\):not([no-intersect]) { left: var(--my-value); }', ]) }) }) @@ -39,15 +39,15 @@ describe('import directive', () => { describe('plugin directive', () => { it('should add variants', async () => { expect(await run('content/variants.html', { directive: 'plugin' })).toIncludeAll([ - '.intersect\\:opacity-50 { &:not([no-intersect]) { opacity: 50%; } }', - '.intersect\\:hover\\:opacity-100 { &:not([no-intersect]) { &:hover { @media (hover: hover) { opacity: 100%; } } } }', + '.intersect\\:opacity-50:not([no-intersect]) { opacity: 50%; }', + '.intersect\\:hover\\:opacity-100:not([no-intersect]):hover { opacity: 100%; }', ]) }) it('should add arbitrary values', async () => { expect(await run('content/arbitrary-values.html', { directive: 'plugin' })).toIncludeAll([ - '.intersect\\:left-\\[100px\\] { &:not([no-intersect]) { left: 100px; } }', - '.intersect\\:left-\\(--my-value\\) { &:not([no-intersect]) { left: var(--my-value); } }', + '.intersect\\:left-\\[100px\\]:not([no-intersect]) { left: 100px; }', + '.intersect\\:left-\\(--my-value\\):not([no-intersect]) { left: var(--my-value); }', ]) }) })