diff options
| author | Matias Niemelä | 2014-02-24 15:12:38 -0500 |
|---|---|---|
| committer | Matias Niemelä | 2014-02-26 14:23:56 -0500 |
| commit | c9245cf759108add2a10ffca4d41b1c68c1e8c76 (patch) | |
| tree | 0d64cff5787289addea29b29b70d1f6a5022c909 /test/ngAnimate/animateSpec.js | |
| parent | 99720fb5ab7259af37f708bc4eeda7cbbe790a69 (diff) | |
| download | angular.js-c9245cf759108add2a10ffca4d41b1c68c1e8c76.tar.bz2 | |
test($animate): ensure staggering timeout tests are secure
Diffstat (limited to 'test/ngAnimate/animateSpec.js')
| -rw-r--r-- | test/ngAnimate/animateSpec.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index 27eeb112..55ec4ae8 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -1259,7 +1259,15 @@ describe("ngAnimate", function() { } //(stagger * index) + (duration + delay) * 150% - $timeout.flush(9500); //0.5 * 4 + 5 * 1.5 = 9500; + //0.5 * 4 + 5 * 1.5 = 9500; + //9500 - 7500 = 2000 + $timeout.flush(1999); //remove 1999 more + + for(var i = 0; i < 5; i++) { + expect(kids[i].hasClass('ng-enter-active')).toBe(true); + } + + $timeout.flush(1); //up to 2000ms for(var i = 0; i < 5; i++) { expect(kids[i].hasClass('ng-enter-active')).toBe(false); |
