From 30ea3f501024ebf8fbe39e5603227f91c1cbeac7 Mon Sep 17 00:00:00 2001 From: RuiAlonso Date: Fri, 11 Mar 2022 15:09:11 +0100 Subject: [PATCH] test: pinball game check ramps are added --- test/game/pinball_game_test.dart | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/game/pinball_game_test.dart b/test/game/pinball_game_test.dart index 4dc93b7f..39ae09b3 100644 --- a/test/game/pinball_game_test.dart +++ b/test/game/pinball_game_test.dart @@ -48,6 +48,38 @@ void main() { }, ); }); + + group('Paths', () { + bool Function(Component) rampSelector() => + (component) => component is T; + flameTester.test( + 'has only one JetpackRamp', + (game) async { + await game.ready(); + + expect( + () => game.children.singleWhere( + rampSelector(), + ), + returnsNormally, + ); + }, + ); + + flameTester.test( + 'has only one SparkyRamp', + (game) async { + await game.ready(); + + expect( + () => game.children.singleWhere( + rampSelector(), + ), + returnsNormally, + ); + }, + ); + }); }, ); });