Closed wesleycho closed 8 years ago
I think it may be best to include a flushRunningAnimations
method instead that does this plus everything that flush
. We could also have another method called flushCallbacks
that does this and have flush
handle flushing pending animations as well as their associated callbacks.
@petebacondarwin and @IgorMinar what do you gentlemen you think?
Should note we were able to work around it by changing to finally
, but it probably is a good thing to implement a solution at some point.
We have an issue in https://github.com/angular-ui/bootstrap/pull/4493 where it turns out that
$animate.flush()
does not flush the animations queued up by $animateCss, so theexpandDone
callback in the promise chain never fires in the collapse directive, which is causing some testing problems.In particular, the
.then
callback in the promise returned by$animateCss(...).start()
never gets called because there is no mechanism in ngMock for flushing out the queued animation.