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

$window mocking not working with ngAnimate since 1.4.0 #11964

Closed
tjokimie opened this issue May 28, 2015 · 1 comment
Closed

$window mocking not working with ngAnimate since 1.4.0 #11964

tjokimie opened this issue May 28, 2015 · 1 comment

Comments

@tjokimie
Copy link

I have tests for a directive that uses $window and ngAnimate. Since 1.4.0 (or 1.4.0-rc.0) I cannot mock $window without having document property set in $window.

This issue is due to var bodyElement = jqLite($document[0].body); in ngAnimate animateQueue.js https://github.com/angular/angular.js/blob/master/src/ngAnimate/animateQueue.js#L108.

I have a JSFiddle demonstrating this problem:

tjokimie added a commit to tjokimie/angular.js that referenced this issue Jun 1, 2015
Use document.body instead of $document[0].body. Enable mocking of $window
without having to add properties that ngAnimate uses internally.

Closes angular#11964
tjokimie added a commit to tjokimie/angular.js that referenced this issue Jun 1, 2015
Use document.body instead of $document[0].body. Enable mocking of $window
without having to add an empty document object into it.

Closes angular#11964
@Narretz Narretz added this to the Purgatory milestone Jun 1, 2015
@Narretz
Copy link
Contributor

Narretz commented Nov 30, 2015

Closing with regards to #11997 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants