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