diff options
| author | Matias Niemelä | 2013-05-26 20:28:47 -0400 | 
|---|---|---|
| committer | Misko Hevery | 2013-05-30 22:01:42 -0700 | 
| commit | a4b9a6aca9a0d4b1e3be2238cf549083776284ba (patch) | |
| tree | 8e0a661772ae7b484fb0a157a826b1864188efc0 /test | |
| parent | a2f9e78a56944b3c5024133770a4b436b4b06149 (diff) | |
| download | angular.js-a4b9a6aca9a0d4b1e3be2238cf549083776284ba.tar.bz2 | |
fix($animator): ensure $animator calculates the highest duration + delay for and transitions and animations together
Diffstat (limited to 'test')
| -rw-r--r-- | test/ng/animatorSpec.js | 27 | 
1 files changed, 27 insertions, 0 deletions
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('<div style="' + styles + '">foo</div>'))($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;' +  | 
