From 64ec5a603f1f69f9a01569977e6e4eb357528fab Mon Sep 17 00:00:00 2001 From: alestiago Date: Thu, 21 Apr 2022 18:43:54 +0100 Subject: [PATCH] feat: changes test query --- .../src/components/spaceship_ramp_test.dart | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/pinball_components/test/src/components/spaceship_ramp_test.dart b/packages/pinball_components/test/src/components/spaceship_ramp_test.dart index 064800bf..c1838006 100644 --- a/packages/pinball_components/test/src/components/spaceship_ramp_test.dart +++ b/packages/pinball_components/test/src/components/spaceship_ramp_test.dart @@ -45,13 +45,15 @@ void main() { final spaceshipRamp = SpaceshipRamp(); await game.addFromBlueprint(spaceshipRamp); await game.ready(); + await tester.pump(); expect( - spaceshipRamp.firstChild()!.current, + spaceshipRamp.components + .whereType() + .first + .current, SpaceshipRampArrowSpriteState.inactive, ); - - game.camera.followVector2(centerForSpaceshipRamp); }, verify: (game, tester) async { await expectLater( @@ -68,9 +70,14 @@ void main() { final spaceshipRamp = SpaceshipRamp(); await game.addFromBlueprint(spaceshipRamp); await game.ready(); + spaceshipRamp.progress(); + await game.ready(); expect( - spaceshipRamp.firstChild()!.current, + spaceshipRamp.components + .whereType() + .first + .current, SpaceshipRampArrowSpriteState.active1, ); @@ -90,13 +97,17 @@ void main() { await game.images.loadAll(assets); final spaceshipRamp = SpaceshipRamp(); await game.addFromBlueprint(spaceshipRamp); + await game.ready(); spaceshipRamp ..progress() ..progress(); await game.ready(); expect( - spaceshipRamp.firstChild()!.current, + spaceshipRamp.components + .whereType() + .first + .current, SpaceshipRampArrowSpriteState.active2, ); @@ -124,7 +135,10 @@ void main() { await game.ready(); expect( - spaceshipRamp.firstChild()!.current, + spaceshipRamp.components + .whereType() + .first + .current, SpaceshipRampArrowSpriteState.active3, ); @@ -152,7 +166,10 @@ void main() { await game.ready(); expect( - spaceshipRamp.firstChild()!.current, + spaceshipRamp.components + .whereType() + .first + .current, SpaceshipRampArrowSpriteState.active4, ); @@ -181,7 +198,10 @@ void main() { await game.ready(); expect( - spaceshipRamp.firstChild()!.current, + spaceshipRamp.components + .whereType() + .first + .current, SpaceshipRampArrowSpriteState.active5, );