chore($animate): fix broken IE8 test

This commit is contained in:
Matias Niemelä
2014-03-28 13:20:47 -04:00
parent 35d635cbcb
commit 8a5972461c

View File

@@ -1332,12 +1332,7 @@ describe("ngAnimate", function() {
}));
it("should intelligently cancel former timeouts and close off a series of elements a final timeout", function() {
var currentTimestamp = Date.now();
spyOn(Date,'now').andCallFake(function() {
return currentTimestamp;
});
var cancellations = 0;
var currentTimestamp, cancellations = 0;
module(function($provide) {
$provide.decorator('$timeout', function($delegate) {
var _cancel = $delegate.cancel;
@@ -1349,6 +1344,15 @@ describe("ngAnimate", function() {
};
return $delegate;
});
return function($sniffer) {
if($sniffer.transitions) {
currentTimestamp = Date.now();
spyOn(Date,'now').andCallFake(function() {
return currentTimestamp;
});
}
}
})
inject(function($animate, $rootScope, $compile, $sniffer, $timeout) {
if (!$sniffer.transitions) return;