Skip to content

Commit 061864e

Browse files
committed
test: for #2
1 parent 9e48e93 commit 061864e

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

test/test.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ import test from 'ava';
33
import plugin from '../src';
44

55
const processing = (input, opts) => {
6-
return postcss([plugin(opts)]).process(input).css;
6+
return postcss([plugin(opts)]).process(input).css;
77
};
88

99
test('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

1515
test('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

Comments
 (0)