From d6f4a2e71908df4c393fdc811de690f06609eb61 Mon Sep 17 00:00:00 2001 From: alestiago Date: Thu, 21 Apr 2022 17:35:41 +0100 Subject: [PATCH] fix: coverage --- .../components/controlled_sparky_computer.dart | 2 +- .../controlled_sparky_computer_test.dart | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/game/components/controlled_sparky_computer.dart b/lib/game/components/controlled_sparky_computer.dart index 46762fd3..b1945c25 100644 --- a/lib/game/components/controlled_sparky_computer.dart +++ b/lib/game/components/controlled_sparky_computer.dart @@ -37,7 +37,7 @@ class SparkyComputerController } /// {@template sparky_turbo_charge_sensor_ball_contact_callback} -/// Turbo charges the [Ball] when it enters the [SparkyComputer]. +/// Turbo charges the [Ball] when it enters the [SparkyComputer] /// {@endtemplate} @visibleForTesting class SparkyTurboChargeSensorBallContactCallback diff --git a/test/game/components/controlled_sparky_computer_test.dart b/test/game/components/controlled_sparky_computer_test.dart index 944afca3..2822141f 100644 --- a/test/game/components/controlled_sparky_computer_test.dart +++ b/test/game/components/controlled_sparky_computer_test.dart @@ -8,21 +8,14 @@ import 'package:pinball/game/game.dart'; import '../../helpers/helpers.dart'; void main() { - group('SparkyComputerController', () { + group('ControlledSparkyComputer', () { TestWidgetsFlutterBinding.ensureInitialized(); final flameTester = FlameTester(EmptyPinballTestGame.new); - late ControlledSparkyComputer controlledSparkyComputer; - - setUp(() { - controlledSparkyComputer = ControlledSparkyComputer(); - }); - - test('can be instantiated', () { - expect( - SparkyComputerController(controlledSparkyComputer), - isA(), - ); + flameTester.test('loads correctly', (game) async { + final sparkyComputer = ControlledSparkyComputer(); + await game.ensureAdd(sparkyComputer); + expect(game.children, contains(sparkyComputer)); }); flameTester.testGameWidget(