From c753b65530e4a3fa5f49b9d72f38f74462faaf40 Mon Sep 17 00:00:00 2001 From: Jochum van der Ploeg Date: Wed, 4 May 2022 12:45:06 +0200 Subject: [PATCH] fix: plunger's pull not correctly working on some devices --- .../test/src/components/plunger_test.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/pinball_components/test/src/components/plunger_test.dart b/packages/pinball_components/test/src/components/plunger_test.dart index abb42d68..fd759f8d 100644 --- a/packages/pinball_components/test/src/components/plunger_test.dart +++ b/packages/pinball_components/test/src/components/plunger_test.dart @@ -141,7 +141,11 @@ void main() { expect(plunger.body.linearVelocity.y, isPositive); - await tester.pump(const Duration(seconds: 2)); + // Call game update at 120 FPS, so that the plunger will act as if it + // was pulled for 2 seconds. + for (var i = 0.0; i < 2; i += 1 / 120) { + game.update(1 / 20); + } expect(plunger.body.linearVelocity.y, isZero); },