@@ -3,18 +3,24 @@ import test from 'ava';
33import plugin from '../src' ;
44
55const processing = ( input , opts ) => {
6- return postcss ( [ plugin ( opts ) ] ) . process ( input ) . css ;
6+ return postcss ( [ plugin ( opts ) ] ) . process ( input ) . css ;
77} ;
88
99test ( 'it should return body color for background' , t => {
10- const expected = 'body{background: #fff;}' ;
11- const value = 'body{background: map-get((body: #fff,main-red: #c53831,link-blue: #0592fb) !default, body);}' ;
12- t . is ( processing ( value ) , expected ) ;
10+ const expected = 'body{background: #fff;}' ;
11+ const value = 'body{background: map-get((body: #fff,main-red: #c53831,link-blue: #0592fb) !default, body);}' ;
12+ t . is ( processing ( value ) , expected ) ;
1313} ) ;
1414
1515test ( 'it should return body color and min-width width fro decl' , t => {
16- const expected = 'body{background: #fff;min-width: 1280px;}' ;
17- const value = 'body{background: map-get((body: #fff,main-red: #c53831,link-blue: #0592fb) !default, body);min-width: map-get((xxs: 0,xs: 576px,sm: 768px,md: 992px,lg: 1280px,xl: 1360px,xxl: 1600px) !default, lg);}' ;
18- t . is ( processing ( value ) , expected ) ;
16+ const expected = 'body{background: #fff;min-width: 1280px;}' ;
17+ const value = 'body{background: map-get((body: #fff,main-red: #c53831,link-blue: #0592fb) !default, body);min-width: map-get((xxs: 0,xs: 576px,sm: 768px,md: 992px,lg: 1280px,xl: 1360px,xxl: 1600px) !default, lg);}' ;
18+ t . is ( processing ( value ) , expected ) ;
19+ } ) ;
20+
21+ test ( 'it should retunr width for at rule @media' , t => {
22+ const expected = '@media (min-width: 1280px) {body {overflow-x: hidden}}' ;
23+ const value = '@media (min-width: map-get((xxs: 0,xs: 576px,sm: 768px,md: 992px,lg: 1280px,xl: 1360px,xxl: 1600px) !default, lg))) {body {overflow-x: hidden}}' ;
24+ t . is ( processing ( value ) , expected ) ;
1925} ) ;
2026
0 commit comments