fix(animations): always fire inner trigger callbacks even if blocked by parent animations (#19753)

Closes #19100

PR Close #19753
This commit is contained in:
Matias Niemelä
2017-10-16 15:21:10 -07:00
committed by Miško Hevery
parent b1f8eb14c8
commit 814f06289b
7 changed files with 228 additions and 32 deletions

View File

@ -40,5 +40,29 @@ export function main() {
player.destroy();
expect(log).toEqual(['started', 'done', 'destroy']);
});
it('should fire start/done callbacks manually when called directly', fakeAsync(() => {
const log: string[] = [];
const player = new NoopAnimationPlayer();
player.onStart(() => log.push('started'));
player.onDone(() => log.push('done'));
flushMicrotasks();
player.triggerCallback('start');
expect(log).toEqual(['started']);
player.play();
expect(log).toEqual(['started']);
player.triggerCallback('done');
expect(log).toEqual(['started', 'done']);
player.finish();
expect(log).toEqual(['started', 'done']);
flushMicrotasks();
expect(log).toEqual(['started', 'done']);
}));
});
}