aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngRoute/directive/ngViewSpec.js
diff options
context:
space:
mode:
authorMatias Niemelàˆ2013-07-22 15:37:45 -0400
committerMisko Hevery2013-07-26 23:49:54 -0700
commit15389b0e377e2a84b85178e993e4940d8098d0ed (patch)
tree06054bded1c252ca0d2c62b1a47267fee4c1eb98 /test/ngRoute/directive/ngViewSpec.js
parent7d69d52acff8578e0f7d6fe57a6c45561a05b182 (diff)
downloadangular.js-15389b0e377e2a84b85178e993e4940d8098d0ed.tar.bz2
fix(ngAnimate): $timeout integration and cancel callbacks added
Diffstat (limited to 'test/ngRoute/directive/ngViewSpec.js')
-rw-r--r--test/ngRoute/directive/ngViewSpec.js32
1 files changed, 6 insertions, 26 deletions
diff --git a/test/ngRoute/directive/ngViewSpec.js b/test/ngRoute/directive/ngViewSpec.js
index 7d96a581..0cc70bc5 100644
--- a/test/ngRoute/directive/ngViewSpec.js
+++ b/test/ngRoute/directive/ngViewSpec.js
@@ -623,7 +623,7 @@ describe('ngView animations', function() {
});
});
- inject(function($rootScope, $compile, $location, $route, $window, $rootElement, $sniffer, $animate) {
+ inject(function($rootScope, $compile, $location, $route, $timeout, $rootElement, $sniffer, $animate) {
element = $compile(html('<div><ng:view onload="load()" class="my-animation"></ng:view></div>'))($rootScope);
$animate.enabled(true);
@@ -632,20 +632,12 @@ describe('ngView animations', function() {
$animate.process('enter'); //ngView
- if($sniffer.transitions) {
- $window.setTimeout.expect(1).process();
- $window.setTimeout.expect(0).process();
- }
+ $timeout.flush();
$animate.process('enter'); //repeat 1
$animate.process('enter'); //repeat 2
- if($sniffer.transitions) {
- $window.setTimeout.expect(1).process();
- $window.setTimeout.expect(1).process();
- $window.setTimeout.expect(0).process();
- $window.setTimeout.expect(0).process();
- }
+ $timeout.flush();
expect(element.text()).toEqual('12');
@@ -653,29 +645,17 @@ describe('ngView animations', function() {
$rootScope.$digest();
$animate.process('leave'); //ngView old
- if($sniffer.transitions) {
- $window.setTimeout.expect(1).process();
- $window.setTimeout.expect(0).process();
- }
+ $timeout.flush();
$animate.process('enter'); //ngView new
- if($sniffer.transitions) {
- $window.setTimeout.expect(1).process();
- $window.setTimeout.expect(0).process();
- }
+ $timeout.flush();
expect(n(element.text())).toEqual(''); //this is midway during the animation
$animate.process('enter'); //ngRepeat 3
$animate.process('enter'); //ngRepeat 4
-
- if($sniffer.transitions) {
- $window.setTimeout.expect(1).process();
- $window.setTimeout.expect(1).process();
- $window.setTimeout.expect(0).process();
- $window.setTimeout.expect(0).process();
- }
+ $timeout.flush();
expect(element.text()).toEqual('34');