Skip to content

Commit 68c3c2e

Browse files
committed
Add test from example at PostHog/posthog#21427
1 parent 026c6bf commit 68c3c2e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/rrweb-snapshot/test/css.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ describe('css parser', () => {
119119
expect(out3).toEqual('[data-aa\\:other] { color: red; }');
120120
});
121121

122+
it('parses nested commas in selectors correctly', () => {
123+
const result = parse(
124+
`
125+
body > ul :is(li:not(:first-of-type) a:hover, li:not(:first-of-type).active a) {
126+
background: 'red';
127+
}
128+
`);
129+
expect((result.stylesheet!.rules[0] as Rule)!.selectors!.length).toEqual(1);
130+
});
131+
122132
it('parses imports with quotes correctly', () => {
123133
const out1 = escapeImportStatement({
124134
cssText: `@import url("/foo.css;900;800"");`,

0 commit comments

Comments
 (0)