From a4b9a6aca9a0d4b1e3be2238cf549083776284ba Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Sun, 26 May 2013 20:28:47 -0400 Subject: fix($animator): ensure $animator calculates the highest duration + delay for and transitions and animations together --- test/ng/animatorSpec.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/ng/animatorSpec.js') diff --git a/test/ng/animatorSpec.js b/test/ng/animatorSpec.js index cf5667d2..43983609 100644 --- a/test/ng/animatorSpec.js +++ b/test/ng/animatorSpec.js @@ -666,6 +666,33 @@ describe("$animator", function() { expect(element[0].style.display).toBe(''); })); + it("should select the highest duration and delay", + inject(function($animator, $rootScope, $compile, $sniffer) { + var styles = 'transition:1s linear all 2s;' + + vendorPrefix + 'transition:1s linear all 2s;' + + 'animation:my_ani 10s 1s;' + + vendorPrefix + 'animation:my_ani 10s 1s;'; + + element = $compile(html('
foo
'))($rootScope); + + var animator = $animator($rootScope, { + ngAnimate : '{show: \'inline-show\'}' + }); + + element.css('display','none'); + expect(element.css('display')).toBe('none'); + + animator.show(element); + if ($sniffer.transitions) { + window.setTimeout.expect(1).process(); + window.setTimeout.expect(11000).process(); + } + else { + expect(window.setTimeout.queue.length).toBe(0); + } + expect(element[0].style.display).toBe(''); + })); + it("should finish the previous transition when a new animation is started", inject(function($animator, $rootScope, $compile, $sniffer) { var style = 'transition: 1s linear all;' + -- cgit v1.2.3