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:
@@ -1,4 +1,3 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/application/pipelines_app.dart';
|
||||
@@ -12,83 +11,66 @@ import 'pipelines_replies.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
testWidgets(
|
||||
'the /pipelines route renders real rows, detail and source ($cupertino)',
|
||||
(tester) async {
|
||||
tester.view.physicalSize = const Size(1100, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
if (cupertino) {
|
||||
tester.platformDispatcher.platformBrightnessTestValue =
|
||||
Brightness.dark;
|
||||
addTearDown(
|
||||
tester.platformDispatcher.clearPlatformBrightnessTestValue,
|
||||
);
|
||||
}
|
||||
testWidgets('the /pipelines route renders real rows, detail and source', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(1100, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
final fixture = PipelineFixture();
|
||||
final channel = FakeChannel()..readyCompleter.complete();
|
||||
var sockets = 0;
|
||||
final client = PipelinesClient(
|
||||
channelFactory: (_) {
|
||||
sockets++;
|
||||
return channel;
|
||||
},
|
||||
);
|
||||
final provider = PlatformRouteInformationProvider(
|
||||
initialRouteInformation: RouteInformation(
|
||||
uri: Uri.parse('/pipelines'),
|
||||
),
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await tester.pumpWidget(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
cupertino: cupertino,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
await replyPipelines(tester, channel, fixture);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('Alpha review'), findsOneWidget);
|
||||
expect(find.text('2 stages · 1 schedule'), findsOneWidget);
|
||||
expect(find.text('Pipelines — Not implemented'), findsNothing);
|
||||
expect(sockets, 1);
|
||||
|
||||
// The shell owns the only navigation bar; the embedded screen adds no
|
||||
// second bar.
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
if (cupertino) {
|
||||
expect(find.byType(CupertinoPageScaffold), findsOneWidget);
|
||||
expect(find.byType(Material), findsNothing);
|
||||
} else {
|
||||
expect(find.byType(Scaffold), findsOneWidget);
|
||||
}
|
||||
|
||||
await tester.tap(find.byKey(const Key('pipeline-row-1')));
|
||||
await tester.pump();
|
||||
await replyPipelineDetail(tester, channel, fixture);
|
||||
await tester.pump();
|
||||
expect(find.text('hash-alpha'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const Key('pipeline-detail-tab-source')));
|
||||
await tester.pump();
|
||||
expect(
|
||||
selectableText(
|
||||
'name: Alpha review\nstages:\n review:\n type: model',
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
final fixture = PipelineFixture();
|
||||
final channel = FakeChannel()..readyCompleter.complete();
|
||||
var sockets = 0;
|
||||
final client = PipelinesClient(
|
||||
channelFactory: (_) {
|
||||
sockets++;
|
||||
return channel;
|
||||
},
|
||||
);
|
||||
}
|
||||
final provider = PlatformRouteInformationProvider(
|
||||
initialRouteInformation: RouteInformation(uri: Uri.parse('/pipelines')),
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await tester.pumpWidget(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
cupertino: false,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
await replyPipelines(tester, channel, fixture);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('Alpha review'), findsOneWidget);
|
||||
expect(find.text('2 stages · 1 schedule'), findsOneWidget);
|
||||
expect(find.text('Pipelines — Not implemented'), findsNothing);
|
||||
expect(sockets, 1);
|
||||
|
||||
// The shell owns the only navigation bar; the embedded screen adds no
|
||||
// second bar.
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
expect(find.byType(Scaffold), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const Key('pipeline-row-1')));
|
||||
await tester.pump();
|
||||
await replyPipelineDetail(tester, channel, fixture);
|
||||
await tester.pump();
|
||||
expect(find.text('hash-alpha'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const Key('pipeline-detail-tab-source')));
|
||||
await tester.pump();
|
||||
expect(
|
||||
selectableText(
|
||||
'name: Alpha review\nstages:\n review:\n type: model',
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import '../features/settings/settings_topic_test_helper.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/application/pipelines_app.dart';
|
||||
@@ -20,7 +19,6 @@ import 'pipelines_replies.dart';
|
||||
void main() {
|
||||
Future<PlatformRouteInformationProvider> pumpApp(
|
||||
WidgetTester tester, {
|
||||
required bool cupertino,
|
||||
required String location,
|
||||
required Size size,
|
||||
}) async {
|
||||
@@ -37,7 +35,7 @@ void main() {
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: PipelinesClient(channelFactory: (_) => channel),
|
||||
cupertino: cupertino,
|
||||
cupertino: false,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
);
|
||||
@@ -52,82 +50,77 @@ void main() {
|
||||
.widget<FloatingDestinationBar>(find.byType(FloatingDestinationBar))
|
||||
.currentIndex;
|
||||
|
||||
for (final cupertino in [false, true]) {
|
||||
final host = cupertino ? 'Cupertino' : 'Material';
|
||||
for (final size in [const Size(390, 844), const Size(1200, 800)]) {
|
||||
testWidgets('$host ${size.width}: the Pipelines bar gear opens Settings '
|
||||
'as a page and Back returns', (tester) async {
|
||||
final provider = await pumpApp(
|
||||
tester,
|
||||
cupertino: cupertino,
|
||||
location: '/pipelines',
|
||||
size: size,
|
||||
);
|
||||
// Four tabs; Settings is none of them.
|
||||
expect(
|
||||
tester
|
||||
.widget<FloatingDestinationBar>(
|
||||
find.byType(FloatingDestinationBar),
|
||||
)
|
||||
.items
|
||||
.map((item) => item.label),
|
||||
['Pipelines', 'Runs', 'Chat', 'Search'],
|
||||
);
|
||||
expect(
|
||||
find.byKey(const ValueKey('shell.destination.settings')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
|
||||
await tapBarAction(
|
||||
tester,
|
||||
find.byKey(const Key('pipelines-open-settings')),
|
||||
'Settings',
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/settings');
|
||||
expect(find.byType(SettingsScreen), findsOneWidget);
|
||||
expect(find.text('Quick switch animation'), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
expect(find.text('Server URL'), findsOneWidget);
|
||||
// A page of Pipelines: Back in its bar, Pipelines still selected.
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('shell.search')), findsNothing);
|
||||
expect(selectedTab(tester), 0);
|
||||
expect(tester.takeException(), isNull);
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('shell.back')));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/pipelines');
|
||||
expect(find.byKey(const Key('pipelines-open-settings')), findsWidgets);
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
}
|
||||
|
||||
testWidgets('$host: the /settings deep link opens the Settings page and '
|
||||
'the system Back closes it to Pipelines', (tester) async {
|
||||
for (final size in [const Size(390, 844), const Size(1200, 800)]) {
|
||||
testWidgets('${size.width}: the Pipelines bar gear opens Settings '
|
||||
'as a page and Back returns', (tester) async {
|
||||
final provider = await pumpApp(
|
||||
tester,
|
||||
cupertino: cupertino,
|
||||
location: '/settings',
|
||||
size: const Size(390, 844),
|
||||
location: '/pipelines',
|
||||
size: size,
|
||||
);
|
||||
// Four tabs; Settings is none of them.
|
||||
expect(
|
||||
tester
|
||||
.widget<FloatingDestinationBar>(
|
||||
find.byType(FloatingDestinationBar),
|
||||
)
|
||||
.items
|
||||
.map((item) => item.label),
|
||||
['Pipelines', 'Runs', 'Chat', 'Search'],
|
||||
);
|
||||
expect(
|
||||
find.byKey(const ValueKey('shell.destination.settings')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
|
||||
await tapBarAction(
|
||||
tester,
|
||||
find.byKey(const Key('pipelines-open-settings')),
|
||||
'Settings',
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/settings');
|
||||
expect(find.byType(SettingsScreen), findsOneWidget);
|
||||
expect(find.text('Quick switch animation'), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
expect(find.text('Server URL'), findsOneWidget);
|
||||
// A page of Pipelines: Back in its bar, Pipelines still selected.
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('shell.search')), findsNothing);
|
||||
expect(selectedTab(tester), 0);
|
||||
expect(tester.takeException(), isNull);
|
||||
|
||||
final handled = await tester.binding.handlePopRoute();
|
||||
expect(handled, isTrue, reason: 'Back closes the page, not the app');
|
||||
await tester.tap(find.byKey(const ValueKey('shell.back')));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/pipelines');
|
||||
expect(find.byKey(const Key('pipelines-open-settings')), findsWidgets);
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsNothing);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
}
|
||||
|
||||
testWidgets('the /settings deep link opens the Settings page and '
|
||||
'the system Back closes it to Pipelines', (tester) async {
|
||||
final provider = await pumpApp(
|
||||
tester,
|
||||
location: '/settings',
|
||||
size: const Size(390, 844),
|
||||
);
|
||||
await tester.pump();
|
||||
expect(find.byType(SettingsScreen), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('shell.back')), findsOneWidget);
|
||||
expect(selectedTab(tester), 0);
|
||||
|
||||
final handled = await tester.binding.handlePopRoute();
|
||||
expect(handled, isTrue, reason: 'Back closes the page, not the app');
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/pipelines');
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import '../features/settings/settings_topic_test_helper.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/application/pipelines_app.dart';
|
||||
@@ -16,89 +15,73 @@ import 'pipelines_replies.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
testWidgets('Settings shares socket and one native bar ($cupertino)', (
|
||||
tester,
|
||||
) async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
if (cupertino) {
|
||||
tester.platformDispatcher.platformBrightnessTestValue = Brightness.dark;
|
||||
addTearDown(tester.platformDispatcher.clearPlatformBrightnessTestValue);
|
||||
}
|
||||
final channel = FakeChannel()..readyCompleter.complete();
|
||||
var sockets = 0;
|
||||
final client = PipelinesClient(
|
||||
channelFactory: (_) {
|
||||
sockets++;
|
||||
return channel;
|
||||
},
|
||||
);
|
||||
final provider = PlatformRouteInformationProvider(
|
||||
initialRouteInformation: RouteInformation(uri: Uri.parse('/pipelines')),
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
await tester.pumpWidget(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
cupertino: cupertino,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
expect(
|
||||
requestOf(channel, 'ping'),
|
||||
isNull,
|
||||
reason: 'Unvisited settings must not issue hidden requests',
|
||||
);
|
||||
await replyPipelines(tester, channel, PipelineFixture());
|
||||
testWidgets('Settings shares socket and one native bar', (tester) async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
final channel = FakeChannel()..readyCompleter.complete();
|
||||
var sockets = 0;
|
||||
final client = PipelinesClient(
|
||||
channelFactory: (_) {
|
||||
sockets++;
|
||||
return channel;
|
||||
},
|
||||
);
|
||||
final provider = PlatformRouteInformationProvider(
|
||||
initialRouteInformation: RouteInformation(uri: Uri.parse('/pipelines')),
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
await tester.pumpWidget(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
cupertino: false,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
expect(
|
||||
requestOf(channel, 'ping'),
|
||||
isNull,
|
||||
reason: 'Unvisited settings must not issue hidden requests',
|
||||
);
|
||||
await replyPipelines(tester, channel, PipelineFixture());
|
||||
|
||||
await tapBarAction(
|
||||
tester,
|
||||
find.byKey(const Key('pipelines-open-settings')),
|
||||
'Settings',
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/settings');
|
||||
expect(find.text('Quick switch animation'), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
expect(find.text('Server URL'), findsOneWidget);
|
||||
if (cupertino) {
|
||||
final title = tester.widget<Text>(find.text('Connection').last);
|
||||
expect(
|
||||
title.style!.color!.computeLuminance(),
|
||||
greaterThan(0.5),
|
||||
reason: 'Cupertino dark host must not inherit light Material text',
|
||||
);
|
||||
}
|
||||
expect(find.text('Settings — Not implemented'), findsNothing);
|
||||
expect(sockets, 1);
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
final ping = requestOf(channel, 'ping')!;
|
||||
channel.incoming.add(
|
||||
jsonEncode({
|
||||
'id': ping['id'],
|
||||
'type': 'pong',
|
||||
'build': {'version': 'settings-fixture'},
|
||||
'time': 'fixture time',
|
||||
'protocol': 2,
|
||||
}),
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(find.textContaining('settings-fixture'), findsOneWidget);
|
||||
expect(
|
||||
find.text(
|
||||
'Protocol mismatch: this page speaks protocol 1, '
|
||||
'the server reports 2.',
|
||||
),
|
||||
findsOneWidget,
|
||||
reason: 'a mismatched server must stay visibly flagged in Settings',
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
}
|
||||
await tapBarAction(
|
||||
tester,
|
||||
find.byKey(const Key('pipelines-open-settings')),
|
||||
'Settings',
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(provider.value.uri.path, '/settings');
|
||||
expect(find.text('Quick switch animation'), findsOneWidget);
|
||||
await selectSettingsTopic(tester, 'Connection');
|
||||
expect(find.text('Server URL'), findsOneWidget);
|
||||
expect(find.text('Settings — Not implemented'), findsNothing);
|
||||
expect(sockets, 1);
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
final ping = requestOf(channel, 'ping')!;
|
||||
channel.incoming.add(
|
||||
jsonEncode({
|
||||
'id': ping['id'],
|
||||
'type': 'pong',
|
||||
'build': {'version': 'settings-fixture'},
|
||||
'time': 'fixture time',
|
||||
'protocol': 2,
|
||||
}),
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(find.textContaining('settings-fixture'), findsOneWidget);
|
||||
expect(
|
||||
find.text(
|
||||
'Protocol mismatch: this page speaks protocol 1, '
|
||||
'the server reports 2.',
|
||||
),
|
||||
findsOneWidget,
|
||||
reason: 'a mismatched server must stay visibly flagged in Settings',
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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