From bb7ffce7eb3c90feff872ef2304f87c2153394cf Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 26 May 2015 12:30:06 +0200 Subject: [PATCH] test(ShadowCss): add tests for keyframe rules --- .../test/render/dom/shadow_dom/shadow_css_spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/angular2/test/render/dom/shadow_dom/shadow_css_spec.ts b/modules/angular2/test/render/dom/shadow_dom/shadow_css_spec.ts index 2de250fcf9..10ab624be5 100644 --- a/modules/angular2/test/render/dom/shadow_dom/shadow_css_spec.ts +++ b/modules/angular2/test/render/dom/shadow_dom/shadow_css_spec.ts @@ -45,6 +45,20 @@ export function main() { expect(s(css, 'a')).toEqual(expected); }); + it('should handle keyframes rules', () => { + var css = '@keyframes foo {0% {transform: translate(-50%) scaleX(0);}}'; + var passRe = RegExpWrapper.create( + '@keyframes foo {\\s*0% {\\s*transform: translate\\(-50%\\) scaleX\\(0\\);\\s*}}'); + expect(RegExpWrapper.test(passRe, s(css, 'a'))).toEqual(true); + }); + + it('should handle -webkit-keyframes rules', () => { + var css = '@-webkit-keyframes foo {0% {transform: translate(-50%) scaleX(0);}}'; + var passRe = RegExpWrapper.create( + '@-webkit-keyframes foo {\\s*0% {\\s*transform: translate\\(-50%\\) scaleX\\(0\\);\\s*}}'); + expect(RegExpWrapper.test(passRe, s(css, 'a'))).toEqual(true); + }); + it('should handle complicated selectors', () => { expect(s('one::before {}', 'a')).toEqual('one[a]::before {}'); expect(s('one two {}', 'a')).toEqual('one[a] two[a] {}');