From a020ab21f4b3ca2087571ffdc214d6f079e55ae9 Mon Sep 17 00:00:00 2001 From: Erick Zanardo Date: Wed, 9 Mar 2022 14:01:37 -0300 Subject: [PATCH] fix: tests --- lib/game/pinball_game.dart | 2 +- test/game/pinball_game_test.dart | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/game/pinball_game.dart b/lib/game/pinball_game.dart index ab2e0786..b8280377 100644 --- a/lib/game/pinball_game.dart +++ b/lib/game/pinball_game.dart @@ -37,7 +37,7 @@ class PinballGame extends Forge2DGame await add(BottomWall(this)); addContactCallback(BottomWallBallContactCallback()); - await _addFlippers(); + unawaited(_addFlippers()); } Future _addFlippers() async { diff --git a/test/game/pinball_game_test.dart b/test/game/pinball_game_test.dart index 7ca02c1d..4dc93b7f 100644 --- a/test/game/pinball_game_test.dart +++ b/test/game/pinball_game_test.dart @@ -22,7 +22,9 @@ void main() { flameTester.test( 'has only one left Flipper', - (game) { + (game) async { + await game.ready(); + expect( () => game.children.singleWhere( flipperSelector(BoardSide.left), @@ -34,7 +36,9 @@ void main() { flameTester.test( 'has only one right Flipper', - (game) { + (game) async { + await game.ready(); + expect( () => game.children.singleWhere( flipperSelector(BoardSide.right),