Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
test($animate): ensure staggering timeout tests are secure
Browse files Browse the repository at this point in the history
  • Loading branch information
matsko committed Feb 26, 2014
1 parent 99720fb commit c9245cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/ngAnimate/animateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c9245cf

Please sign in to comment.