test(ShadowCss): add tests for keyframe rules

This commit is contained in:
Victor Berchet 2015-05-26 12:30:06 +02:00
parent 551586ced0
commit bb7ffce7eb
1 changed files with 14 additions and 0 deletions

View File

@ -45,6 +45,20 @@ export function main() {
expect(s(css, 'a')).toEqual(expected); 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', () => { it('should handle complicated selectors', () => {
expect(s('one::before {}', 'a')).toEqual('one[a]::before {}'); expect(s('one::before {}', 'a')).toEqual('one[a]::before {}');
expect(s('one two {}', 'a')).toEqual('one[a] two[a] {}'); expect(s('one two {}', 'a')).toEqual('one[a] two[a] {}');