From fa7b741ce02740d2aba833fdc69bf619d9e71fd2 Mon Sep 17 00:00:00 2001 From: Abestanis Date: Sun, 27 Oct 2024 21:30:48 +0100 Subject: [PATCH] Stop playback before taking the golden screenshot in player_route --- test/golden/routes_golden_test.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/golden/routes_golden_test.dart b/test/golden/routes_golden_test.dart index 9a92affbb..88ace969f 100644 --- a/test/golden/routes_golden_test.dart +++ b/test/golden/routes_golden_test.dart @@ -179,11 +179,11 @@ void main() { (WidgetTester tester) async { await tester.tap(find.byType(SongTile)); await tester.pump(); // Flush micro-tasks so to flush handling of the tap. - // Don't use `pumpAndSettle` because we have animations because we are playing a song. - await tester.pump(const Duration(seconds: 1)); + // Stop the playback to avoid animations when taking the golden screenshot. + await MusicPlayer.handler!.stop(); + await tester.pumpAndSettle(const Duration(seconds: 1)); expect(playerRouteController.value, 1.0); }, - customGoldenPump: (WidgetTester tester) => tester.pump(Duration.zero), playerInterfaceColorStylesToTest: PlayerInterfaceColorStyle.values.toSet(), );