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

Commit aea76f0

Browse files
petebacondarwinIgorMinar
authored andcommitted
fix(animateSpec): run digest to enable animations before tests
1 parent ffa9d0a commit aea76f0

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

test/ngAnimate/animateSpec.js

+4-13
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ describe("ngAnimate", function() {
77
var ss, body;
88
beforeEach(module(function() {
99
body = jqLite(document.body);
10-
return function($window, $document, $animate, $timeout) {
10+
return function($window, $document, $animate, $timeout, $rootScope) {
1111
ss = createMockStyleSheet($document, $window);
1212
try {
1313
$timeout.flush();
1414
} catch(e) {}
1515
$animate.enabled(true);
16+
$rootScope.$digest();
1617
};
1718
}));
1819

@@ -36,17 +37,7 @@ describe("ngAnimate", function() {
3637

3738
describe("enable / disable", function() {
3839

39-
it("should work for all animations", function() {
40-
var $animate, initialState = null;
41-
42-
angular.bootstrap(body, ['ngAnimate',function() {
43-
return function(_$animate_) {
44-
$animate = _$animate_;
45-
initialState = $animate.enabled();
46-
}
47-
}]);
48-
49-
expect(initialState).toBe(false);
40+
it("should work for all animations", inject(function($animate) {
5041

5142
expect($animate.enabled()).toBe(true);
5243

@@ -55,7 +46,7 @@ describe("ngAnimate", function() {
5546

5647
expect($animate.enabled(1)).toBe(true);
5748
expect($animate.enabled()).toBe(true);
58-
});
49+
}));
5950

6051
it('should place a hard disable on all child animations', function() {
6152
var count = 0;

0 commit comments

Comments
 (0)