Restore ordinary root launches with query parameters and verify Back intent

This commit is contained in:
2026-11-08 01:13:58 +00:00
parent eee3b70684
commit 032d4cd6c0
5 changed files with 46 additions and 4 deletions
@@ -209,4 +209,24 @@ void main() {
);
expect(tester.takeException(), isNull);
});
for (final cupertino in [false, true]) {
testWidgets('ordinary root with query restores its tab ($cupertino)', (
tester,
) async {
final store = MemoryTabLocationsStore()
..value = const TabLocationsSnapshot(
routes: {AppDestination.pipelines: AppRoute.settings},
);
final app = await mount(
tester,
route: '/?appearance=cupertino',
cupertino: cupertino,
store: store,
);
await tester.pumpAndSettle();
expect(app.provider.value.uri.path, '/settings');
expect(find.byType(SettingsScreen), findsOneWidget);
expect(tester.takeException(), isNull);
});
}
}
@@ -357,6 +357,10 @@ void main() {
await tester.tap(find.byKey(const ValueKey('shell.destination.pipelines')));
await tester.pumpAndSettle();
expect(provider.value.uri.path, '/settings');
// A tab retap preserves Settings; explicit Back returns to Pipelines.
await tester.tap(find.byKey(const Key('shell.back')));
await tester.pumpAndSettle();
expect(provider.value.uri.path, '/pipelines');
expect(find.text('Probe release'), findsOneWidget);
// Only the accepted detail's invalidation re-read the list; showing it