From aea76f0d5c43dc17f1319d0a45d2ce50fddf72e4 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 7 Nov 2013 18:44:27 +0000 Subject: fix(animateSpec): run digest to enable animations before tests --- test/ngAnimate/animateSpec.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'test/ngAnimate/animateSpec.js') diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index 562d94a0..8ad7ed79 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -7,12 +7,13 @@ describe("ngAnimate", function() { var ss, body; beforeEach(module(function() { body = jqLite(document.body); - return function($window, $document, $animate, $timeout) { + return function($window, $document, $animate, $timeout, $rootScope) { ss = createMockStyleSheet($document, $window); try { $timeout.flush(); } catch(e) {} $animate.enabled(true); + $rootScope.$digest(); }; })); @@ -36,17 +37,7 @@ describe("ngAnimate", function() { describe("enable / disable", function() { - it("should work for all animations", function() { - var $animate, initialState = null; - - angular.bootstrap(body, ['ngAnimate',function() { - return function(_$animate_) { - $animate = _$animate_; - initialState = $animate.enabled(); - } - }]); - - expect(initialState).toBe(false); + it("should work for all animations", inject(function($animate) { expect($animate.enabled()).toBe(true); @@ -55,7 +46,7 @@ describe("ngAnimate", function() { expect($animate.enabled(1)).toBe(true); expect($animate.enabled()).toBe(true); - }); + })); it('should place a hard disable on all child animations', function() { var count = 0; -- cgit v1.2.3