fix: fixed test

pull/119/head
alestiago 4 years ago
parent bf8c72b52c
commit c2214a04d8

@ -153,8 +153,9 @@ void main() {
tester.testGameWidget( tester.testGameWidget(
'add DashNestActivated event', 'add DashNestActivated event',
setUp: (game, tester) async { setUp: (game, tester) async {
final flutterForest = FlutterForest(); await game.ready();
await game.ensureAdd(flutterForest); final flutterForest =
game.descendants().whereType<FlutterForest>().first;
await game.ensureAdd(ball); await game.ensureAdd(ball);
final bumpers = final bumpers =
@ -163,11 +164,9 @@ void main() {
for (final bumper in bumpers) { for (final bumper in bumpers) {
beginContact(game, bumper, ball); beginContact(game, bumper, ball);
final controller = bumper.firstChild<DashNestBumperController>()!; final controller = bumper.firstChild<DashNestBumperController>()!;
// TODO(alestiago): Investiagate why is is being called twice
// instead of once.
verify( verify(
() => gameBloc.add(DashNestActivated(controller.id)), () => gameBloc.add(DashNestActivated(controller.id)),
).called(2); ).called(1);
} }
}, },
); );

Loading…
Cancel
Save