Anchor desktop Files and Runs menus
Use Material popup menus for file actions and anchor Runs sorting choices to the sort button while retaining the phone fallback. Update callers, tests, and implementation notes to match the desktop behavior.
This commit is contained in:
@@ -7,7 +7,6 @@ import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/runs_controller.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/runs_filter_sheet.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/runs_filters.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/runs_list.dart';
|
||||
import 'package:pipelines_app/ui/layout/app_sheet_header.dart';
|
||||
|
||||
@@ -139,44 +138,14 @@ void main() {
|
||||
expect(tester.widget<ListTile>(anyTime).selected, isTrue);
|
||||
});
|
||||
|
||||
testWidgets('Material sort sheet has the same header', (tester) async {
|
||||
testWidgets('Material sort opens an anchored choice menu', (tester) async {
|
||||
await mount(tester, cupertino: false);
|
||||
await tester.tap(find.byKey(const ValueKey('runs.sort')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(runsSortTitle), findsOneWidget);
|
||||
await tester.tap(find.byKey(runsSortDoneKey));
|
||||
expect(find.byKey(const ValueKey('app-choice-menu')), findsOneWidget);
|
||||
await tester.tap(find.text('Oldest first'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text(runsSortTitle), findsNothing);
|
||||
expect(controller.sort, 'newest_first');
|
||||
});
|
||||
|
||||
testWidgets('Cupertino sort sheet marks the selected order with an icon', (
|
||||
tester,
|
||||
) async {
|
||||
await mount(tester, cupertino: true);
|
||||
await tester.tap(find.byKey(const ValueKey('runs.sort')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('✓ Newest first'), findsNothing);
|
||||
final newestFirst = find.widgetWithText(
|
||||
CupertinoActionSheetAction,
|
||||
'Newest first',
|
||||
);
|
||||
expect(newestFirst, findsOneWidget);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: newestFirst,
|
||||
matching: find.byIcon(CupertinoIcons.checkmark),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
final selected = find.descendant(
|
||||
of: newestFirst,
|
||||
matching: find.byWidgetPredicate(
|
||||
(widget) => widget is Semantics && widget.properties.selected == true,
|
||||
),
|
||||
);
|
||||
expect(selected, findsOneWidget);
|
||||
expect(controller.sort, 'oldest_first');
|
||||
});
|
||||
|
||||
testWidgets('the usage page is honest when nothing was reported', (
|
||||
|
||||
Reference in New Issue
Block a user