This repository was archived by the owner on Jan 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ import { genBase62Hash , sheetCompiler } from '../src/_internal' ;
2+ import { max_lg } from '../src/core' ;
3+
4+ test ( 'sheetCompiler produces expected output' , async ( ) => {
5+ const object = {
6+ e2e : {
7+ color : 'pink' ,
8+ [ max_lg ] : {
9+ color : 'aqua' ,
10+ } ,
11+ } ,
12+ } ;
13+
14+ const base62Hash = genBase62Hash ( object , 5 ) ;
15+ const { styleSheet } = sheetCompiler ( object , base62Hash ) ;
16+
17+ expect ( styleSheet ) . toContain ( '.e2e_' ) ;
18+ expect ( styleSheet ) . toContain ( 'color: pink;' ) ;
19+ expect ( styleSheet ) . toContain ( '@media (max-width: 1024px)' ) ;
20+ expect ( styleSheet ) . toContain ( 'color: aqua;' ) ;
21+ } ) ;
Original file line number Diff line number Diff line change 1+ import { genBase62Hash , styleCompiler } from '../src/_internal' ;
2+ import { max_lg } from '../src/core' ;
3+
4+ test ( 'styleCompiler produces expected output' , async ( ) => {
5+ const object = {
6+ color : 'blue' ,
7+ margin : '10px' ,
8+ [ max_lg ] : {
9+ color : 'aqua' ,
10+ margin : '24px' ,
11+ } ,
12+ } ;
13+
14+ const base62Hash = genBase62Hash ( object , 5 ) ;
15+ const { styleSheet } = styleCompiler ( object , base62Hash ) ;
16+
17+ expect ( styleSheet ) . toContain ( 'color: blue;' ) ;
18+ expect ( styleSheet ) . toContain ( 'margin: 10px' ) ;
19+ expect ( styleSheet ) . toContain ( '@media (max-width: 1024px)' ) ;
20+ expect ( styleSheet ) . toContain ( 'color: aqua;' ) ;
21+ expect ( styleSheet ) . toContain ( 'margin: 24px' ) ;
22+ } ) ;
You can’t perform that action at this time.
0 commit comments