Skip to content

Commit f9ef968

Browse files
authored
test: add case to verify no CSS var media queries in extracted styles (#30)
1 parent 89751ed commit f9ef968

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/index.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,13 @@ describe('Static-Style-Extract', () => {
8484
const cssText = extractStyle();
8585
expect(cssText).toContain('.ant-modal-confirm-title');
8686
});
87+
88+
it('should not contain media queries with CSS var in min-width or max-width', () => {
89+
const cssText = extractStyle();
90+
// Check for media queries using CSS var like: @media (min-width: var(--xxx))
91+
const cssVarMediaRegex =
92+
/@media\s*\([^)]*(?:min-width|max-width)\s*:\s*var\(/;
93+
const match = cssVarMediaRegex.test(cssText);
94+
expect(match).toBe(false);
95+
});
8796
});

0 commit comments

Comments
 (0)