2016-06-23 12:47:54 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2016-08-02 18:53:34 -04:00
|
|
|
import {CssRule, ShadowCss, processRules} from '@angular/compiler/src/shadow_css';
|
2017-03-02 15:12:46 -05:00
|
|
|
import {normalizeCSS} from '@angular/platform-browser/testing/src/browser_util';
|
2015-03-23 17:10:55 -04:00
|
|
|
|
|
|
|
export function main() {
|
|
|
|
describe('ShadowCss', function() {
|
|
|
|
|
2015-05-26 12:25:39 -04:00
|
|
|
function s(css: string, contentAttr: string, hostAttr: string = '') {
|
2016-08-12 18:20:58 -04:00
|
|
|
const shadowCss = new ShadowCss();
|
|
|
|
const shim = shadowCss.shimCssText(css, contentAttr, hostAttr);
|
|
|
|
const nlRegexp = /\n/g;
|
2016-08-26 19:11:57 -04:00
|
|
|
return normalizeCSS(shim.replace(nlRegexp, ''));
|
2015-03-23 17:10:55 -04:00
|
|
|
}
|
|
|
|
|
2015-05-26 12:25:39 -04:00
|
|
|
it('should handle empty string', () => { expect(s('', 'a')).toEqual(''); });
|
2015-03-23 17:10:55 -04:00
|
|
|
|
|
|
|
it('should add an attribute to every rule', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = 'one {color: red;}two {color: red;}';
|
|
|
|
const expected = 'one[a] {color:red;}two[a] {color:red;}';
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
2015-09-29 20:27:44 -04:00
|
|
|
it('should handle invalid css', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = 'one {color: red;}garbage';
|
|
|
|
const expected = 'one[a] {color:red;}garbage';
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should add an attribute to every selector', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = 'one, two {color: red;}';
|
|
|
|
const expected = 'one[a], two[a] {color:red;}';
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
2015-10-30 18:09:04 -04:00
|
|
|
it('should support newlines in the selector and content ', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = 'one, \ntwo {\ncolor: red;}';
|
|
|
|
const expected = 'one[a], two[a] {color:red;}';
|
2015-10-30 18:09:04 -04:00
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
2015-03-23 17:10:55 -04:00
|
|
|
it('should handle media rules', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = '@media screen and (max-width:800px, max-height:100%) {div {font-size:50px;}}';
|
|
|
|
const expected =
|
2015-10-30 18:09:04 -04:00
|
|
|
'@media screen and (max-width:800px, max-height:100%) {div[a] {font-size:50px;}}';
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
2016-09-30 19:26:24 -04:00
|
|
|
it('should handle page rules', () => {
|
|
|
|
const css = '@page {div {font-size:50px;}}';
|
|
|
|
const expected = '@page {div[a] {font-size:50px;}}';
|
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle document rules', () => {
|
|
|
|
const css = '@document url(http://www.w3.org/) {div {font-size:50px;}}';
|
|
|
|
const expected = '@document url(http://www.w3.org/) {div[a] {font-size:50px;}}';
|
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
2015-03-23 17:10:55 -04:00
|
|
|
it('should handle media rules with simple rules', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = '@media screen and (max-width: 800px) {div {font-size: 50px;}} div {}';
|
|
|
|
const expected = '@media screen and (max-width:800px) {div[a] {font-size:50px;}} div[a] {}';
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
2016-04-17 21:18:11 -04:00
|
|
|
it('should handle support rules', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = '@supports (display: flex) {section {display: flex;}}';
|
|
|
|
const expected = '@supports (display:flex) {section[a] {display:flex;}}';
|
2016-04-17 21:18:11 -04:00
|
|
|
expect(s(css, 'a')).toEqual(expected);
|
|
|
|
});
|
|
|
|
|
2015-06-02 08:59:35 -04:00
|
|
|
// Check that the browser supports unprefixed CSS animation
|
2015-10-29 13:57:54 -04:00
|
|
|
it('should handle keyframes rules', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = '@keyframes foo {0% {transform:translate(-50%) scaleX(0);}}';
|
2015-10-29 13:57:54 -04:00
|
|
|
expect(s(css, 'a')).toEqual(css);
|
|
|
|
});
|
2015-05-26 06:30:06 -04:00
|
|
|
|
2015-10-29 13:57:54 -04:00
|
|
|
it('should handle -webkit-keyframes rules', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = '@-webkit-keyframes foo {0% {-webkit-transform:translate(-50%) scaleX(0);}}';
|
2015-10-29 13:57:54 -04:00
|
|
|
expect(s(css, 'a')).toEqual(css);
|
|
|
|
});
|
2015-05-26 06:30:06 -04:00
|
|
|
|
2015-03-23 17:10:55 -04:00
|
|
|
it('should handle complicated selectors', () => {
|
|
|
|
expect(s('one::before {}', 'a')).toEqual('one[a]::before {}');
|
|
|
|
expect(s('one two {}', 'a')).toEqual('one[a] two[a] {}');
|
2015-09-29 20:27:44 -04:00
|
|
|
expect(s('one > two {}', 'a')).toEqual('one[a] > two[a] {}');
|
|
|
|
expect(s('one + two {}', 'a')).toEqual('one[a] + two[a] {}');
|
|
|
|
expect(s('one ~ two {}', 'a')).toEqual('one[a] ~ two[a] {}');
|
2016-08-12 18:20:58 -04:00
|
|
|
const res = s('.one.two > three {}', 'a'); // IE swap classes
|
2015-05-27 04:22:30 -04:00
|
|
|
expect(res == '.one.two[a] > three[a] {}' || res == '.two.one[a] > three[a] {}')
|
|
|
|
.toEqual(true);
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(s('one[attr="value"] {}', 'a')).toEqual('one[attr="value"][a] {}');
|
|
|
|
expect(s('one[attr=value] {}', 'a')).toEqual('one[attr="value"][a] {}');
|
|
|
|
expect(s('one[attr^="value"] {}', 'a')).toEqual('one[attr^="value"][a] {}');
|
|
|
|
expect(s('one[attr$="value"] {}', 'a')).toEqual('one[attr$="value"][a] {}');
|
|
|
|
expect(s('one[attr*="value"] {}', 'a')).toEqual('one[attr*="value"][a] {}');
|
|
|
|
expect(s('one[attr|="value"] {}', 'a')).toEqual('one[attr|="value"][a] {}');
|
2016-09-18 18:58:19 -04:00
|
|
|
expect(s('one[attr~="value"] {}', 'a')).toEqual('one[attr~="value"][a] {}');
|
2016-09-26 12:55:05 -04:00
|
|
|
expect(s('one[attr="va lue"] {}', 'a')).toEqual('one[attr="va lue"][a] {}');
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(s('one[attr] {}', 'a')).toEqual('one[attr][a] {}');
|
|
|
|
expect(s('[is="one"] {}', 'a')).toEqual('[is="one"][a] {}');
|
|
|
|
});
|
|
|
|
|
2016-10-04 18:40:31 -04:00
|
|
|
describe((':host'), () => {
|
|
|
|
it('should handle no context',
|
|
|
|
() => { expect(s(':host {}', 'a', 'a-host')).toEqual('[a-host] {}'); });
|
2016-08-26 19:11:57 -04:00
|
|
|
|
2016-10-10 12:15:15 -04:00
|
|
|
it('should handle tag selector',
|
|
|
|
() => { expect(s(':host(ul) {}', 'a', 'a-host')).toEqual('ul[a-host] {}'); });
|
2016-08-26 19:11:57 -04:00
|
|
|
|
2016-10-04 18:40:31 -04:00
|
|
|
it('should handle class selector',
|
|
|
|
() => { expect(s(':host(.x) {}', 'a', 'a-host')).toEqual('.x[a-host] {}'); });
|
|
|
|
|
|
|
|
it('should handle attribute selector', () => {
|
|
|
|
expect(s(':host([a="b"]) {}', 'a', 'a-host')).toEqual('[a="b"][a-host] {}');
|
|
|
|
expect(s(':host([a=b]) {}', 'a', 'a-host')).toEqual('[a="b"][a-host] {}');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle multiple tag selectors', () => {
|
|
|
|
expect(s(':host(ul,li) {}', 'a', 'a-host')).toEqual('ul[a-host], li[a-host] {}');
|
|
|
|
expect(s(':host(ul,li) > .z {}', 'a', 'a-host'))
|
|
|
|
.toEqual('ul[a-host] > .z[a], li[a-host] > .z[a] {}');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle multiple class selectors', () => {
|
|
|
|
expect(s(':host(.x,.y) {}', 'a', 'a-host')).toEqual('.x[a-host], .y[a-host] {}');
|
|
|
|
expect(s(':host(.x,.y) > .z {}', 'a', 'a-host'))
|
|
|
|
.toEqual('.x[a-host] > .z[a], .y[a-host] > .z[a] {}');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle multiple attribute selectors', () => {
|
|
|
|
expect(s(':host([a="b"],[c=d]) {}', 'a', 'a-host'))
|
|
|
|
.toEqual('[a="b"][a-host], [c="d"][a-host] {}');
|
|
|
|
});
|
2016-10-10 12:15:15 -04:00
|
|
|
|
2016-11-07 16:56:04 -05:00
|
|
|
it('should handle pseudo selectors', () => {
|
2016-10-10 12:15:15 -04:00
|
|
|
expect(s(':host(:before) {}', 'a', 'a-host')).toEqual('[a-host]:before {}');
|
|
|
|
expect(s(':host:before {}', 'a', 'a-host')).toEqual('[a-host]:before {}');
|
2016-11-07 16:56:04 -05:00
|
|
|
expect(s(':host:nth-child(8n+1) {}', 'a', 'a-host')).toEqual('[a-host]:nth-child(8n+1) {}');
|
|
|
|
expect(s(':host:nth-of-type(8n+1) {}', 'a', 'a-host'))
|
|
|
|
.toEqual('[a-host]:nth-of-type(8n+1) {}');
|
|
|
|
expect(s(':host(.class):before {}', 'a', 'a-host')).toEqual('.class[a-host]:before {}');
|
|
|
|
expect(s(':host.class:before {}', 'a', 'a-host')).toEqual('.class[a-host]:before {}');
|
|
|
|
expect(s(':host(:not(p)):before {}', 'a', 'a-host')).toEqual('[a-host]:not(p):before {}');
|
2016-10-10 12:15:15 -04:00
|
|
|
});
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
|
|
|
|
2016-10-04 18:40:31 -04:00
|
|
|
describe((':host-context'), () => {
|
|
|
|
it('should handle tag selector', () => {
|
|
|
|
expect(s(':host-context(div) {}', 'a', 'a-host')).toEqual('div[a-host], div [a-host] {}');
|
|
|
|
expect(s(':host-context(ul) > .y {}', 'a', 'a-host'))
|
|
|
|
.toEqual('ul[a-host] > .y[a], ul [a-host] > .y[a] {}');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle class selector', () => {
|
|
|
|
expect(s(':host-context(.x) {}', 'a', 'a-host')).toEqual('.x[a-host], .x [a-host] {}');
|
2016-09-30 14:42:46 -04:00
|
|
|
|
2016-10-04 18:40:31 -04:00
|
|
|
expect(s(':host-context(.x) > .y {}', 'a', 'a-host'))
|
|
|
|
.toEqual('.x[a-host] > .y[a], .x [a-host] > .y[a] {}');
|
|
|
|
});
|
2016-09-30 14:42:46 -04:00
|
|
|
|
2016-10-04 18:40:31 -04:00
|
|
|
it('should handle attribute selector', () => {
|
|
|
|
expect(s(':host-context([a="b"]) {}', 'a', 'a-host'))
|
|
|
|
.toEqual('[a="b"][a-host], [a="b"] [a-host] {}');
|
|
|
|
expect(s(':host-context([a=b]) {}', 'a', 'a-host'))
|
|
|
|
.toEqual('[a=b][a-host], [a="b"] [a-host] {}');
|
|
|
|
});
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should support polyfill-next-selector', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
let css = s('polyfill-next-selector {content: \'x > y\'} z {}', 'a');
|
2015-10-29 13:57:54 -04:00
|
|
|
expect(css).toEqual('x[a] > y[a]{}');
|
2015-03-23 17:10:55 -04:00
|
|
|
|
|
|
|
css = s('polyfill-next-selector {content: "x > y"} z {}', 'a');
|
2015-10-29 13:57:54 -04:00
|
|
|
expect(css).toEqual('x[a] > y[a]{}');
|
2016-09-30 16:20:48 -04:00
|
|
|
|
|
|
|
css = s(`polyfill-next-selector {content: 'button[priority="1"]'} z {}`, 'a');
|
2016-10-04 18:40:31 -04:00
|
|
|
expect(css).toEqual('button[priority="1"][a]{}');
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should support polyfill-unscoped-rule', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
let css = s('polyfill-unscoped-rule {content: \'#menu > .bar\';color: blue;}', 'a');
|
2016-08-26 19:11:57 -04:00
|
|
|
expect(css).toContain('#menu > .bar {;color:blue;}');
|
2015-03-23 17:10:55 -04:00
|
|
|
|
2015-05-21 11:12:10 -04:00
|
|
|
css = s('polyfill-unscoped-rule {content: "#menu > .bar";color: blue;}', 'a');
|
2016-08-26 19:11:57 -04:00
|
|
|
expect(css).toContain('#menu > .bar {;color:blue;}');
|
2016-09-30 16:20:48 -04:00
|
|
|
|
|
|
|
css = s(`polyfill-unscoped-rule {content: 'button[priority="1"]'}`, 'a');
|
|
|
|
expect(css).toContain('button[priority="1"] {}');
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
|
|
|
|
2015-07-10 13:38:24 -04:00
|
|
|
it('should support multiple instances polyfill-unscoped-rule', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css =
|
2016-06-08 19:38:52 -04:00
|
|
|
s('polyfill-unscoped-rule {content: \'foo\';color: blue;}' +
|
|
|
|
'polyfill-unscoped-rule {content: \'bar\';color: blue;}',
|
|
|
|
'a');
|
2016-08-26 19:11:57 -04:00
|
|
|
expect(css).toContain('foo {;color:blue;}');
|
|
|
|
expect(css).toContain('bar {;color:blue;}');
|
2015-07-10 13:38:24 -04:00
|
|
|
});
|
|
|
|
|
2015-03-23 17:10:55 -04:00
|
|
|
it('should support polyfill-rule', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
let css = s('polyfill-rule {content: \':host.foo .bar\';color: blue;}', 'a', 'a-host');
|
2016-09-30 14:42:46 -04:00
|
|
|
expect(css).toEqual('.foo[a-host] .bar[a] {;color:blue;}');
|
2015-03-23 17:10:55 -04:00
|
|
|
|
2015-05-27 04:22:30 -04:00
|
|
|
css = s('polyfill-rule {content: ":host.foo .bar";color:blue;}', 'a', 'a-host');
|
2016-09-30 14:42:46 -04:00
|
|
|
expect(css).toEqual('.foo[a-host] .bar[a] {;color:blue;}');
|
2016-09-30 16:20:48 -04:00
|
|
|
|
|
|
|
css = s(`polyfill-rule {content: 'button[priority="1"]'}`, 'a', 'a-host');
|
|
|
|
expect(css).toEqual('button[priority="1"][a] {}');
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle ::shadow', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = s('x::shadow > y {}', 'a');
|
2015-03-23 17:10:55 -04:00
|
|
|
expect(css).toEqual('x[a] > y[a] {}');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle /deep/', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = s('x /deep/ y {}', 'a');
|
2016-03-11 16:35:28 -05:00
|
|
|
expect(css).toEqual('x[a] y {}');
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle >>>', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const css = s('x >>> y {}', 'a');
|
2016-03-11 16:35:28 -05:00
|
|
|
expect(css).toEqual('x[a] y {}');
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
2015-10-07 16:37:56 -04:00
|
|
|
|
2015-10-29 13:57:54 -04:00
|
|
|
it('should pass through @import directives', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const styleStr = '@import url("https://fonts.googleapis.com/css?family=Roboto");';
|
|
|
|
const css = s(styleStr, 'a');
|
2015-10-29 13:57:54 -04:00
|
|
|
expect(css).toEqual(styleStr);
|
|
|
|
});
|
2015-10-15 15:15:42 -04:00
|
|
|
|
2015-10-29 13:57:54 -04:00
|
|
|
it('should shim rules after @import', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const styleStr = '@import url("a"); div {}';
|
|
|
|
const css = s(styleStr, 'a');
|
2015-10-29 13:57:54 -04:00
|
|
|
expect(css).toEqual('@import url("a"); div[a] {}');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should leave calc() unchanged', () => {
|
2016-08-12 18:20:58 -04:00
|
|
|
const styleStr = 'div {height:calc(100% - 55px);}';
|
|
|
|
const css = s(styleStr, 'a');
|
2015-10-29 13:57:54 -04:00
|
|
|
expect(css).toEqual('div[a] {height:calc(100% - 55px);}');
|
|
|
|
});
|
|
|
|
|
2015-10-30 18:09:04 -04:00
|
|
|
it('should strip comments', () => { expect(s('/* x */b {c}', 'a')).toEqual('b[a] {c}'); });
|
2015-10-29 13:57:54 -04:00
|
|
|
|
2015-10-30 18:09:04 -04:00
|
|
|
it('should ignore special characters in comments',
|
|
|
|
() => { expect(s('/* {;, */b {c}', 'a')).toEqual('b[a] {c}'); });
|
2015-10-29 13:57:54 -04:00
|
|
|
|
2015-10-30 18:09:04 -04:00
|
|
|
it('should support multiline comments',
|
|
|
|
() => { expect(s('/* \n */b {c}', 'a')).toEqual('b[a] {c}'); });
|
2016-08-12 04:39:43 -04:00
|
|
|
|
|
|
|
it('should keep sourceMappingURL comments', () => {
|
|
|
|
expect(s('b {c}/*# sourceMappingURL=data:x */', 'a'))
|
|
|
|
.toEqual('b[a] {c}/*# sourceMappingURL=data:x */');
|
|
|
|
expect(s('b {c}/* #sourceMappingURL=data:x */', 'a'))
|
|
|
|
.toEqual('b[a] {c}/* #sourceMappingURL=data:x */');
|
|
|
|
});
|
2015-10-30 18:09:04 -04:00
|
|
|
});
|
2015-10-29 13:57:54 -04:00
|
|
|
|
2015-10-30 18:09:04 -04:00
|
|
|
describe('processRules', () => {
|
|
|
|
describe('parse rules', () => {
|
|
|
|
function captureRules(input: string): CssRule[] {
|
2016-09-30 16:06:14 -04:00
|
|
|
const result: CssRule[] = [];
|
|
|
|
processRules(input, (cssRule) => {
|
2015-10-30 18:09:04 -04:00
|
|
|
result.push(cssRule);
|
|
|
|
return cssRule;
|
|
|
|
});
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
it('should work with empty css', () => { expect(captureRules('')).toEqual([]); });
|
|
|
|
|
|
|
|
it('should capture a rule without body',
|
|
|
|
() => { expect(captureRules('a;')).toEqual([new CssRule('a', '')]); });
|
|
|
|
|
|
|
|
it('should capture css rules with body',
|
|
|
|
() => { expect(captureRules('a {b}')).toEqual([new CssRule('a', 'b')]); });
|
|
|
|
|
|
|
|
it('should capture css rules with nested rules', () => {
|
2016-06-08 19:38:52 -04:00
|
|
|
expect(captureRules('a {b {c}} d {e}')).toEqual([
|
|
|
|
new CssRule('a', 'b {c}'), new CssRule('d', 'e')
|
|
|
|
]);
|
2015-10-30 18:09:04 -04:00
|
|
|
});
|
|
|
|
|
2015-12-16 02:47:48 -05:00
|
|
|
it('should capture multiple rules where some have no body', () => {
|
2016-06-08 19:38:52 -04:00
|
|
|
expect(captureRules('@import a ; b {c}')).toEqual([
|
|
|
|
new CssRule('@import a', ''), new CssRule('b', 'c')
|
|
|
|
]);
|
2015-10-30 18:09:04 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('modify rules', () => {
|
|
|
|
it('should allow to change the selector while preserving whitespaces', () => {
|
2016-06-08 19:38:52 -04:00
|
|
|
expect(processRules(
|
2016-09-30 16:06:14 -04:00
|
|
|
'@import a; b {c {d}} e {f}',
|
|
|
|
(cssRule: CssRule) => new CssRule(cssRule.selector + '2', cssRule.content)))
|
2015-10-30 18:09:04 -04:00
|
|
|
.toEqual('@import a2; b2 {c {d}} e2 {f}');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should allow to change the content', () => {
|
2016-06-08 19:38:52 -04:00
|
|
|
expect(processRules(
|
2016-09-30 16:06:14 -04:00
|
|
|
'a {b}',
|
|
|
|
(cssRule: CssRule) => new CssRule(cssRule.selector, cssRule.content + '2')))
|
2015-10-30 18:09:04 -04:00
|
|
|
.toEqual('a {b2}');
|
|
|
|
});
|
2015-10-29 13:57:54 -04:00
|
|
|
});
|
2015-03-23 17:10:55 -04:00
|
|
|
});
|
|
|
|
}
|