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

Commit

Permalink
fix(animateSpec): run digest to enable animations before tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin authored and IgorMinar committed Nov 8, 2013
1 parent ffa9d0a commit aea76f0
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions test/ngAnimate/animateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
}));

Expand All @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit aea76f0

Please sign in to comment.