File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Verify that combined selectors will be separated correctly.
3+ */
4+
5+ import { test , expect } from '@playwright/test' ;
6+ import { cssToHtml } from '../src/index' ;
7+
8+ const css = `
9+ h1,
10+ p.subtitle,
11+ p.content {
12+ content: 'a';
13+ }
14+ ` ;
15+
16+ test ( 'Comma' , async ( { page } ) => {
17+ await page . addScriptTag ( { path : './tests/GeneratorScript.js' } ) ;
18+
19+ const result = await page . evaluate ( async ( css ) => {
20+ document . body = cssToHtml ( css ) ;
21+
22+ return document . body . querySelector ( 'h1' ) ?. innerHTML === 'a'
23+ && document . body . querySelector ( 'p.subtitle' ) ?. innerHTML === 'a'
24+ && document . body . querySelector ( 'p.content' ) ?. innerHTML === 'a' ;
25+ } , css ) ;
26+
27+ expect ( result ) . toBeDefined ( ) ;
28+ expect ( result ) . toBe ( true ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments