@@ -43,7 +43,7 @@ describe("api", () => {
43
43
expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
44
44
} ) ;
45
45
46
- it ( "should toString with media query" , ( ) => {
46
+ it ( "should toString with media query list " , ( ) => {
47
47
const m = api ( ( i ) => i [ 1 ] ) ;
48
48
49
49
const m1 = [ 1 , "body { a: 1; }" , "screen" ] ;
@@ -59,6 +59,60 @@ describe("api", () => {
59
59
expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
60
60
} ) ;
61
61
62
+ it ( "should toString with layer" , ( ) => {
63
+ const m = api ( ( i ) => i [ 1 ] ) ;
64
+
65
+ const m1 = [ 1 , "body { a: 1; }" , "" , "" , "layer(default)" ] ;
66
+ const m2 = [ 2 , "body { b: 2; }" , "" ] ;
67
+ const m3 = [ 3 , "body { c: 3; }" , "" ] ;
68
+ const m4 = [ 4 , "body { d: 4; }" , "" ] ;
69
+
70
+ m . i ( [ m2 , m3 ] , "" ) ;
71
+ m . i ( [ m2 ] , "" ) ;
72
+ m . i ( [ m2 , m4 ] , "print" ) ;
73
+ m . push ( m1 ) ;
74
+
75
+ expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
76
+ } ) ;
77
+
78
+ it ( "should toString with supports" , ( ) => {
79
+ const m = api ( ( i ) => i [ 1 ] ) ;
80
+
81
+ const m1 = [ 1 , "body { a: 1; }" , "" , "supports (display: grid)" ] ;
82
+ const m2 = [ 2 , "body { b: 2; }" , "" ] ;
83
+ const m3 = [ 3 , "body { c: 3; }" , "" ] ;
84
+ const m4 = [ 4 , "body { d: 4; }" , "" ] ;
85
+
86
+ m . i ( [ m2 , m3 ] , "" ) ;
87
+ m . i ( [ m2 ] , "" ) ;
88
+ m . i ( [ m2 , m4 ] , "print" ) ;
89
+ m . push ( m1 ) ;
90
+
91
+ expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
92
+ } ) ;
93
+
94
+ it ( "should toString with media query list, layer and supports" , ( ) => {
95
+ const m = api ( ( i ) => i [ 1 ] ) ;
96
+
97
+ const m1 = [
98
+ 1 ,
99
+ "body { a: 1; }" ,
100
+ "screen" ,
101
+ "supports (display: grid)" ,
102
+ "layer(default)" ,
103
+ ] ;
104
+ const m2 = [ 2 , "body { b: 2; }" , "" ] ;
105
+ const m3 = [ 3 , "body { c: 3; }" , "" ] ;
106
+ const m4 = [ 4 , "body { d: 4; }" , "" ] ;
107
+
108
+ m . i ( [ m2 , m3 ] , "" ) ;
109
+ m . i ( [ m2 ] , "" ) ;
110
+ m . i ( [ m2 , m4 ] , "print" ) ;
111
+ m . push ( m1 ) ;
112
+
113
+ expect ( m . toString ( ) ) . toMatchSnapshot ( ) ;
114
+ } ) ;
115
+
62
116
it ( "should import modules" , ( ) => {
63
117
const m = api ( ( i ) => i [ 1 ] ) ;
64
118
const m1 = [ 1 , "body { a: 1; }" , "(orientation:landscape)" ] ;
0 commit comments