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

Including angular-mocks breaks ngAnimate animations #5917

Closed
scottopherson opened this issue Jan 21, 2014 · 5 comments
Closed

Including angular-mocks breaks ngAnimate animations #5917

scottopherson opened this issue Jan 21, 2014 · 5 comments

Comments

@scottopherson
Copy link

I was working on an app with the latest 1.2.9 release and all was well until I started to use ngMockE2E's $httpBackend to do some backend-less development. Once angular-mocks.js was included on the page my animations would no longer work. What's interesting is removing ngMockE2E as a dependency for my app is not enough to get animations working again, angular-mocks.js must be removed entirely. Here's some fiddles to help illustrate the issue:

angular-mocks not included (works as expected):
http://jsfiddle.net/8y3Ey/

screen shot 2014-01-21 at 5 12 06 pm

angular-mocks included (animations appear to start but halt on enter):
http://jsfiddle.net/q8SQg/

screen shot 2014-01-21 at 5 07 25 pm

Current workarounds are to either remove animation classes from elements (don't use animations) or to refrain from including angular-mocks.js (don't use ngMock/ngMockE2E). There's been quite a few releases since I last used angular mocks so it's possible that I'm just doing something incorrectly.

@ghost ghost assigned matsko Jan 22, 2014
@IgorMinar
Copy link
Contributor

This is because when angular-mocks is loaded it will mock out a task queue that is being used by ngAnimation.

This change was done in 1.2.9 because we didn't realize that one would want to use angular-mocks.js in non-unit-testing mode. This was a wrong assumption. We need to correct it.

@matsko can we just modify the mock queue to not be loaded by default but instead require unit tests that need it to explicitly load this module?

@matsko
Copy link
Contributor

matsko commented Jan 22, 2014

Yes we need to properly figure this out. I'm actually thinking of redoing the mock.animate module since we have callbacks now. Once that is ready then this will be fixed.

matsko added a commit to matsko/angular.js that referenced this issue Jan 23, 2014
matsko added a commit to matsko/angular.js that referenced this issue Jan 23, 2014
matsko added a commit to matsko/angular.js that referenced this issue Jan 23, 2014
@scottopherson
Copy link
Author

Awesome 👍

@matsko
Copy link
Contributor

matsko commented Jan 25, 2014

We ran into some scheduling issues with 1.2.10 so this will be in 1.2.11. It should be reviewed and merged in at the start of the week so you can use the snapshot version once that's in. Sorry for the delay.

@tbosch tbosch modified the milestones: 1.2.12, 1.2.11 Feb 3, 2014
@IgorMinar
Copy link
Contributor

@matsko what's the status on this one? we need to get this in asap.

matsko added a commit to matsko/angular.js that referenced this issue Feb 6, 2014
@matsko matsko closed this as completed in 4224cd5 Feb 6, 2014
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.

4 participants