fix(animations): ensure the web-animations driver properly handles empty keyframes (#20648)
Closes #15858 PR Close #20648
This commit is contained in:

committed by
Jason Aden

parent
10771d0bd8
commit
c26e1bba1d
@ -33,6 +33,24 @@ export function main() {
|
||||
expect(p.log).toEqual(['pause', 'play']);
|
||||
});
|
||||
|
||||
it('should allow an empty set of keyframes with a set of previous styles', () => {
|
||||
const previousKeyframes = [
|
||||
{opacity: 0, offset: 0},
|
||||
{opacity: 1, offset: 1},
|
||||
];
|
||||
|
||||
const previousPlayer = new WebAnimationsPlayer(element, previousKeyframes, {duration: 1000});
|
||||
previousPlayer.play();
|
||||
previousPlayer.finish();
|
||||
previousPlayer.beforeDestroy();
|
||||
|
||||
const EMPTY_KEYFRAMES: any[] = [];
|
||||
const player =
|
||||
new WebAnimationsPlayer(element, EMPTY_KEYFRAMES, {duration: 1000}, [previousPlayer]);
|
||||
player.play();
|
||||
player.destroy();
|
||||
});
|
||||
|
||||
it('should not pause the player if created and started before initialized', () => {
|
||||
const keyframes = [
|
||||
{opacity: 0, offset: 0},
|
||||
|
Reference in New Issue
Block a user