feat: Add triggerQuitOnInitForTest to GameScreen for deterministic testing

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-23 17:52:02 +01:00
parent ae3b0deb04
commit 3a7ec50abf
2 changed files with 10 additions and 11 deletions
@@ -56,20 +56,14 @@ void main() {
home: GameScreen(
wolf3d: wolf3d,
skipEngineBootstrapForTest: true,
triggerQuitOnInitForTest: true,
appExitHandler: () async {
appExitCallCount++;
},
),
),
);
final dynamic state = tester.state(find.byType(GameScreen));
await Future.wait<void>([
state.debugQuitForTest() as Future<void>,
state.debugQuitForTest() as Future<void>,
state.debugQuitForTest() as Future<void>,
]);
await tester.pump(const Duration(milliseconds: 10));
expect(audio.stopAllAudioCallCount, 1);
expect(audio.disposeCallCount, 1);