Skip to content

Commit

Permalink
test(animation): adds more asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Nov 28, 2016
1 parent 4aa1ada commit 76df841
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,11 @@ export class Animation {
* ROOT ANIMATION
*/
_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) {
// congrats! a successful transition completed!
Expand All @@ -499,7 +503,7 @@ export class Animation {
// if all goes well this fallback should never fire

// clear the other async end events from firing
self._tm = 0;
self._tm = undefined;
self._clearAsync();

// set the after styles
Expand All @@ -510,8 +514,6 @@ export class Animation {
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
self._unrgTrns = transitionEnd(self._transEl(), onTransitionEnd);

Expand Down

0 comments on commit 76df841

Please sign in to comment.