Skip to content

Commit 5719df0

Browse files
committed
test: added relevant test
1 parent 8cbc482 commit 5719df0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

packages/postcss-if-function/test/plugin.test.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,40 @@ describe('postcss-if-function plugin', () => {
9494
await run(input, expected);
9595
});
9696

97+
it('should handle multiple concatenated if() functions', async () => {
98+
const input = `
99+
.responsive {
100+
padding: if(
101+
media(width >= 1200px): 40px; media(width >= 768px): 30px;
102+
media(width >= 480px): 20px; else: 15px
103+
);
104+
}`;
105+
106+
const expected = `.responsive {
107+
padding: 15px;
108+
}
109+
110+
@media (width >= 1200px) {
111+
.responsive {
112+
padding: 40px;
113+
}
114+
}
115+
116+
@media (width >= 768px) {
117+
.responsive {
118+
padding: 30px;
119+
}
120+
}
121+
122+
@media (width >= 480px) {
123+
.responsive {
124+
padding: 20px;
125+
}
126+
}`;
127+
128+
await run(input, expected);
129+
});
130+
97131
it('should handle CSS that does not contain if() functions', async () => {
98132
const input = `
99133
.normal {

0 commit comments

Comments
 (0)