Refine Settings destination shell integration
Keep Settings navigation independent while preserving shell actions and destination-specific state. Add the reviewed chat, run-entry, layout, and regression-test updates needed by the destination behavior.
This commit is contained in:
@@ -58,12 +58,6 @@ Future<void> tab(WidgetTester tester, String name) async {
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
}
|
||||
|
||||
/// The system Back, as the platform sends it (not a tap on the page's own bar).
|
||||
Future<void> systemBack(WidgetTester tester) async {
|
||||
await tester.binding.handlePopRoute();
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
void main() {
|
||||
// The first-run walkthrough would sit over the Pipelines tab and absorb the
|
||||
// bar taps these tests make; a device that has seen it has no overlay.
|
||||
@@ -78,6 +72,8 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
await tab(tester, 'settings');
|
||||
expect(app.provider.value.uri.path, '/settings');
|
||||
// A destination opened from its nav item: no Back.
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
final settingsState = tester.state(find.byType(SettingsScreen));
|
||||
await tab(tester, 'runs');
|
||||
expect(app.provider.value.uri.path, '/runs');
|
||||
@@ -86,7 +82,12 @@ void main() {
|
||||
expect(app.provider.value.uri.path, '/settings');
|
||||
expect(tester.state(find.byType(SettingsScreen)), same(settingsState));
|
||||
await tab(tester, 'pipelines');
|
||||
expect(app.provider.value.uri.path, '/pipelines');
|
||||
expect(
|
||||
app.provider.value.uri.path,
|
||||
'/pipelines',
|
||||
reason: 'the Pipelines item leaves Settings for its list',
|
||||
);
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
@@ -316,9 +317,9 @@ void main() {
|
||||
expect(tester.widget<PipelinesScreen>(hidden).initialPipelineId, 1);
|
||||
await tab(tester, 'settings');
|
||||
expect(app.provider.value.uri.path, '/settings');
|
||||
// Back returns to the destination opened before Settings: the open
|
||||
// pipeline, whose state is still mounted.
|
||||
await systemBack(tester);
|
||||
// Settings has no Back; the Pipelines item returns to the open pipeline.
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
await tab(tester, 'pipelines');
|
||||
expect(app.provider.value.uri.path, '/pipelines/1');
|
||||
expect(tester.state(find.byType(PipelinesScreen)), same(pipelineState));
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user