@@ -259,13 +259,13 @@ test('handles negative top, left, bottom, and right from scale', () => {
259
259
260
260
test ( 'skip breakpoints' , ( ) => {
261
261
const result = css ( {
262
- width : [ '100%' , , '50%' ] ,
262
+ width : [ '100%' , , '50%' ] ,
263
263
} ) ( theme )
264
264
expect ( result ) . toEqual ( {
265
265
width : '100%' ,
266
266
'@media screen and (min-width: 52em)' : {
267
267
width : '50%' ,
268
- }
268
+ } ,
269
269
} )
270
270
} )
271
271
@@ -290,9 +290,9 @@ test('padding shorthand does not collide with nested p selector', () => {
290
290
291
291
test ( 'ignores array values longer than breakpoints' , ( ) => {
292
292
const result = css ( {
293
- width : [ 32 , 64 , 128 , 256 , 512 ]
293
+ width : [ 32 , 64 , 128 , 256 , 512 ] ,
294
294
} ) ( {
295
- breakpoints : [ '32em' , '40em' ] ,
295
+ breakpoints : [ '32em' , '40em' ] ,
296
296
} )
297
297
expect ( result ) . toEqual ( {
298
298
width : 32 ,
@@ -403,6 +403,31 @@ test('returns outline color from theme', () => {
403
403
outlineColor : 'primary' ,
404
404
} ) ( theme )
405
405
expect ( result ) . toEqual ( {
406
- outlineColor : 'tomato'
406
+ outlineColor : 'tomato' ,
407
+ } )
408
+ } )
409
+
410
+ test ( 'returns correct media query order' , ( ) => {
411
+ const result = css ( {
412
+ width : [ '100%' , , '50%' ] ,
413
+ color : [ 'red' , 'green' , 'blue' ] ,
414
+ } ) ( theme )
415
+ const keys = Object . keys ( result )
416
+ expect ( keys ) . toEqual ( [
417
+ 'width' ,
418
+ 'color' ,
419
+ '@media screen and (min-width: 40em)' ,
420
+ '@media screen and (min-width: 52em)' ,
421
+ ] )
422
+ expect ( result ) . toEqual ( {
423
+ width : '100%' ,
424
+ color : 'red' ,
425
+ '@media screen and (min-width: 40em)' : {
426
+ color : 'green' ,
427
+ } ,
428
+ '@media screen and (min-width: 52em)' : {
429
+ width : '50%' ,
430
+ color : 'blue' ,
431
+ } ,
407
432
} )
408
433
} )
0 commit comments