|
|
@ -44,6 +44,13 @@ describe('px-to-viewport', function() { |
|
|
|
|
|
|
|
expect(processed).toBe(expected); |
|
|
|
}); |
|
|
|
|
|
|
|
it('should not add properties that already exist', function () { |
|
|
|
var expected = '.rule { font-size: 16px; font-size: 5vw; }'; |
|
|
|
var processed = postcss(pxToViewport()).process(expected).css; |
|
|
|
|
|
|
|
expect(processed).toBe(expected); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('value parsing', function() { |
|
|
@ -293,6 +300,18 @@ describe('exclude', function () { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('replace', function () { |
|
|
|
it('should leave fallback pixel unit with root em value', function () { |
|
|
|
var options = { |
|
|
|
replace: false |
|
|
|
}; |
|
|
|
var processed = postcss(pxToViewport(options)).process(basicCSS).css; |
|
|
|
var expected = '.rule { font-size: 15px; font-size: 4.6875vw }'; |
|
|
|
|
|
|
|
expect(processed).toBe(expected); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
describe('filter-prop-list', function () { |
|
|
|
it('should find "exact" matches from propList', function () { |
|
|
|
var propList = ['font-size', 'margin', '!padding', '*border*', '*', '*y', '!*font*']; |
|
|
@ -342,3 +361,4 @@ describe('filter-prop-list', function () { |
|
|
|
expect(filterPropList.notEndWith(propList).join()).toBe(expected); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|