test(library): expect the sort sheet to scroll at its cap

With the file size sorts there are fourteen options, which no longer
fit a 915 point phone. The sheet now stops at its 85% cap and scrolls,
so the test checks the cap and reaches the last sort by scrolling.
This commit is contained in:
zarzet committed 2026-10-23 15:39:44 +07:00
1 parent 5f2a4dae14
commit 8edc344191
1 file changed
+4 -4
+4 -4
View File
@@ -342,9 +342,10 @@ void main() {
await tester.pump(const Duration(milliseconds: 500));
expect(find.text('Shell navigation').hitTestable(), findsNothing);
final sortSheet = find.byType(AppBottomSheet);
final sheetHeight = tester.getSize(sortSheet).height;
expect(sheetHeight, lessThan(915 * 0.85));
expect(find.text('Genre (Z-A)').hitTestable(), findsOneWidget);
// Every sort no longer fits a phone: the sheet stops at its cap and
// scrolls, leaving the screen above it visible.
expect(tester.getSize(sortSheet).height, closeTo(915 * 0.85, 1));
expect(find.text('Latest').hitTestable(), findsWidgets);
final sheetScroll = find.descendant(
of: sortSheet,
matching: find.byType(SingleChildScrollView),
@@ -367,7 +368,6 @@ void main() {
await tester.pump();
await tester.pump(const Duration(milliseconds: 400));
expect(tester.getSize(sortSheet).height, closeTo(915 * 0.85, 1));
expect(tester.getSize(sortSheet).height, greaterThan(sheetHeight));
await tester.drag(sheetScroll, const Offset(0, -200));
await tester.pump();
await tester.pump(const Duration(milliseconds: 500));