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.
This commit is contained in:
edde746
2026-08-07 08:43:47 +02:00
parent f63d0fe49e
commit f5ccaab3ab
+7 -5
View File
@@ -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);
});