test: check animation onComplete

pull/312/head
Allison Ryan 3 years ago
parent b5816e50e1
commit 911cff084c

@ -78,5 +78,23 @@ void main() {
isNotNull, isNotNull,
); );
}); });
flameTester.test(
'flap stops animating after animation completes',
(game) async {
final flapper = Flapper();
await game.ensureAdd(flapper);
final flapSpriteAnimationComponent =
flapper.firstChild<FlapSpriteAnimationComponent>()!;
flapSpriteAnimationComponent.playing = true;
game.update(
flapSpriteAnimationComponent.animation!.totalDuration() + 0.1,
);
expect(flapSpriteAnimationComponent.playing, isFalse);
},
);
}); });
} }

Loading…
Cancel
Save