diff --git a/lib/game/components/game_flow_controller.dart b/lib/game/components/game_flow_controller.dart index 73d8be2b..4af93610 100644 --- a/lib/game/components/game_flow_controller.dart +++ b/lib/game/components/game_flow_controller.dart @@ -19,21 +19,21 @@ class GameFlowController extends ComponentController @override void onNewState(GameState state) { if (state.isGameOver) { - initialsInput(); + _initialsInput(); } else { start(); } } /// Puts the game in the initials input state. - void initialsInput() { + void _initialsInput() { // TODO(erickzanardo): implement score submission and "navigate" to the // next page component.descendants().whereType().first.initialsInput( score: state?.score ?? 0, characterIconPath: component.characterTheme.leaderboardIcon.keyName, ); - component.firstChild()?.focusOnGameOverBackbox(); + component.firstChild()!.focusOnGameOverBackbox(); } /// Puts the game in the playing state. diff --git a/test/game/components/backbox/backbox_test.dart b/test/game/components/backbox/backbox_test.dart index a8e75a0f..6e15a7cc 100644 --- a/test/game/components/backbox/backbox_test.dart +++ b/test/game/components/backbox/backbox_test.dart @@ -61,25 +61,22 @@ void main() { }, ); - group('renders correctly', () { - flameTester.testGameWidget( - 'empty', - setUp: (game, tester) async { - await game.images.loadAll(assets); - game.camera.zoom = 6; - game.camera.followVector2(Vector2(0, -130)); - await game.ensureAdd(Backbox()); - await game.ready(); - await tester.pump(); - }, - verify: (game, tester) async { - await expectLater( - find.byGame(), - matchesGoldenFile('../golden/backbox/empty.png'), - ); - }, - ); - }); + flameTester.testGameWidget( + 'renders correctly', + setUp: (game, tester) async { + await game.images.loadAll(assets); + game.camera.zoom = 6; + game.camera.followVector2(Vector2(0, -130)); + await game.ensureAdd(Backbox()); + await tester.pump(); + }, + verify: (game, tester) async { + await expectLater( + find.byGame(), + matchesGoldenFile('../golden/backbox.png'), + ); + }, + ); flameTester.test( 'initialsInput adds InitialsInputDisplay', diff --git a/test/game/components/golden/backbox/empty.png b/test/game/components/golden/backbox.png similarity index 100% rename from test/game/components/golden/backbox/empty.png rename to test/game/components/golden/backbox.png