Fix the ngMock issue with ngAnimate

Closes #5822
Closes #5917