test(animation): adds more asserts

This commit is contained in:
Manu Mtz.-Almeida
2016-11-28 01:34:46 +01:00
parent 4aa1ada7d5
commit 76df8412b4

View File

@ -478,7 +478,11 @@ export class Animation {
* ROOT ANIMATION * ROOT ANIMATION
*/ */
_asyncEnd(dur: number, shouldComplete: boolean) { _asyncEnd(dur: number, shouldComplete: boolean) {
var self = this; assert(!this._unrgTrns, '_unrgTrns must be null');
assert(!this._tm, '_tm must be null');
assert(dur > 0, 'duration can not be 0 in async animations');
const self = this;
function onTransitionEnd(ev: any) { function onTransitionEnd(ev: any) {
// congrats! a successful transition completed! // congrats! a successful transition completed!
@ -499,7 +503,7 @@ export class Animation {
// if all goes well this fallback should never fire // if all goes well this fallback should never fire
// clear the other async end events from firing // clear the other async end events from firing
self._tm = 0; self._tm = undefined;
self._clearAsync(); self._clearAsync();
// set the after styles // set the after styles
@ -510,8 +514,6 @@ export class Animation {
self._didFinishAll(shouldComplete, true, false); self._didFinishAll(shouldComplete, true, false);
} }
assert(dur > 0, 'duration can not be 0 in async animations');
// set the TRANSITION END event on one of the transition elements // set the TRANSITION END event on one of the transition elements
self._unrgTrns = transitionEnd(self._transEl(), onTransitionEnd); self._unrgTrns = transitionEnd(self._transEl(), onTransitionEnd);