aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngAnimate/animateSpec.js
diff options
context:
space:
mode:
authorPete Bacon Darwin2013-11-07 18:44:27 +0000
committerIgor Minar2013-11-08 01:03:18 -0800
commitaea76f0d5c43dc17f1319d0a45d2ce50fddf72e4 (patch)
tree59e938185a3dcc942d5fc52f2d2d412205eea834 /test/ngAnimate/animateSpec.js
parentffa9d0a6db137cba4090e569b8ed4e25a711314e (diff)
downloadangular.js-aea76f0d5c43dc17f1319d0a45d2ce50fddf72e4.tar.bz2
fix(animateSpec): run digest to enable animations before tests
Diffstat (limited to 'test/ngAnimate/animateSpec.js')
-rw-r--r--test/ngAnimate/animateSpec.js17
1 files changed, 4 insertions, 13 deletions
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;