fix(animations): only require one flushMicrotasks call when testing animations

This commit is contained in:
Matias Niemelä
2017-05-18 19:26:20 -07:00
parent eed67ddafb
commit 6cb93c1fac
6 changed files with 101 additions and 30 deletions

View File

@ -80,9 +80,14 @@ export function listenOnPlayer(
export function copyAnimationEvent(
e: AnimationEvent, phaseName?: string, totalTime?: number): AnimationEvent {
return makeAnimationEvent(
const event = makeAnimationEvent(
e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName,
totalTime == undefined ? e.totalTime : totalTime);
const data = (e as any)['_data'];
if (data != null) {
(event as any)['_data'] = data;
}
return event;
}
export function makeAnimationEvent(