Remove Cupertino pipeline branches
Keep the pipeline feature on its existing Material path because the app runs under MaterialApp and never selects Cupertino hosts. Preserve public cupertino parameters and required Cupertino icon values for later cleanup and shared controls.
This commit is contained in:
@@ -22,7 +22,6 @@ Future<({PlatformRouteInformationProvider provider, FakeChannel channel})>
|
||||
mount(
|
||||
WidgetTester tester, {
|
||||
String route = '/pipelines',
|
||||
bool cupertino = false,
|
||||
TabLocationsStore? store,
|
||||
}) async {
|
||||
tester.view.physicalSize = const Size(560, 1000);
|
||||
@@ -39,7 +38,7 @@ mount(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
cupertino: cupertino,
|
||||
cupertino: false,
|
||||
serverId: 'navigation-test',
|
||||
routeInformationProvider: provider,
|
||||
tabLocationsStore: store,
|
||||
@@ -58,44 +57,41 @@ Future<void> tab(WidgetTester tester, String name) async {
|
||||
|
||||
void main() {
|
||||
setUp(() => SharedPreferences.setMockInitialValues({}));
|
||||
for (final cupertino in [false, true]) {
|
||||
testWidgets(
|
||||
'Settings is retained inside Pipelines across tab switches ($cupertino)',
|
||||
(tester) async {
|
||||
final app = await mount(tester, cupertino: cupertino);
|
||||
await replyPipelines(tester, app.channel, PipelineFixture());
|
||||
await tester.pumpAndSettle();
|
||||
await tapBarAction(
|
||||
tester,
|
||||
find.byKey(const Key('pipelines-open-settings')),
|
||||
'Settings',
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(app.provider.value.uri.path, '/settings');
|
||||
final settingsState = tester.state(find.byType(SettingsScreen));
|
||||
await tab(tester, 'chat');
|
||||
expect(app.provider.value.uri.path, '/chat');
|
||||
await tab(tester, 'pipelines');
|
||||
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,
|
||||
'/settings',
|
||||
reason: 'tab retap is not Back',
|
||||
);
|
||||
await tester.tap(find.byKey(const ValueKey('shell.back')));
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
expect(
|
||||
app.provider.value.uri.path,
|
||||
'/pipelines',
|
||||
reason: 'explicit Back still exits Settings',
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
},
|
||||
testWidgets('Settings is retained inside Pipelines across tab switches', (
|
||||
tester,
|
||||
) async {
|
||||
final app = await mount(tester);
|
||||
await replyPipelines(tester, app.channel, PipelineFixture());
|
||||
await tester.pumpAndSettle();
|
||||
await tapBarAction(
|
||||
tester,
|
||||
find.byKey(const Key('pipelines-open-settings')),
|
||||
'Settings',
|
||||
);
|
||||
}
|
||||
await tester.pumpAndSettle();
|
||||
expect(app.provider.value.uri.path, '/settings');
|
||||
final settingsState = tester.state(find.byType(SettingsScreen));
|
||||
await tab(tester, 'chat');
|
||||
expect(app.provider.value.uri.path, '/chat');
|
||||
await tab(tester, 'pipelines');
|
||||
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,
|
||||
'/settings',
|
||||
reason: 'tab retap is not Back',
|
||||
);
|
||||
await tester.tap(find.byKey(const ValueKey('shell.back')));
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
expect(
|
||||
app.provider.value.uri.path,
|
||||
'/pipelines',
|
||||
reason: 'explicit Back still exits Settings',
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
testWidgets(
|
||||
'per-tab locations survive app recreation; an explicit deep link wins',
|
||||
(tester) async {
|
||||
@@ -209,24 +205,19 @@ 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,
|
||||
testWidgets('ordinary root with query restores its tab', (tester) async {
|
||||
final store = MemoryTabLocationsStore()
|
||||
..value = const TabLocationsSnapshot(
|
||||
routes: {AppDestination.pipelines: AppRoute.settings},
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(app.provider.value.uri.path, '/settings');
|
||||
expect(find.byType(SettingsScreen), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
final app = await mount(
|
||||
tester,
|
||||
route: '/?appearance=cupertino',
|
||||
store: store,
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(app.provider.value.uri.path, '/settings');
|
||||
expect(find.byType(SettingsScreen), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user