From f5ccaab3ab243b8d1e0bde9620014504f8f6dde1 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Thu, 6 Aug 2026 04:34:53 +0200 Subject: [PATCH] test(player): anchor the passthrough absence check to the audio block The check that keeps Audio Passthrough out of the in-player settings sheet dragged the first Scrollable ten times and then asserted the label was absent. That scrolling never moved: at the pumped 900x700 viewport the sheet fits its own content, so maxScrollExtent is 0 and the offset stays there through every drag. The assertion passed identically with no drags at all. It caught a reintroduced toggle only because the whole list happens to sit in the element tree at rest. Grow the sheet, shrink the viewport or give it a lazy delegate and findsNothing starts passing because the label is offscreen rather than gone, with nothing in the test to say so. Land on the audio block that used to hold the toggle first, then assert the absence. scrollUntilVisible throws when that block is missing entirely, so the guard fails loudly instead of quietly weakening. --- test/widgets/video_settings_sheet_test.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/widgets/video_settings_sheet_test.dart b/test/widgets/video_settings_sheet_test.dart index c6bf2cb6..a98a3948 100644 --- a/test/widgets/video_settings_sheet_test.dart +++ b/test/widgets/video_settings_sheet_test.dart @@ -42,11 +42,13 @@ void main() { // Video Playback owns it, alongside Tunneled Playback. await _pumpSheet(tester); - final scrollable = find.byType(Scrollable).first; - for (var i = 0; i < 10; i++) { - await tester.drag(scrollable, const Offset(0, -300)); - await tester.pumpAndSettle(); - } + // Positive control: land on the audio block that used to hold the toggle. Without + // it, findsNothing below would also pass for an unbuilt or off-screen region, which + // is what a bare scroll-then-assert silently degrades into. scrollUntilVisible + // throws when the block is missing entirely, so the guard fails loudly instead. + await tester.scrollUntilVisible(find.text('Normalize Loudness'), 300, scrollable: find.byType(Scrollable).first); + await tester.pumpAndSettle(); + expect(find.text('Downmix to Stereo'), findsOneWidget); expect(find.text('Audio Passthrough'), findsNothing); });