Skip to content

Commit

Permalink
Stop playback before taking the golden screenshot in player_route
Browse files Browse the repository at this point in the history
  • Loading branch information
Abestanis committed Oct 27, 2024
1 parent e2ebcfa commit fa7b741
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/golden/routes_golden_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);

Expand Down

0 comments on commit fa7b741

Please sign in to comment.