Remove Cupertino shell branches
Keep the Material-only shell path while preserving public cupertino parameters for callers. Narrow matching tests to Material hosts and behavior because the app always runs under MaterialApp.
This commit is contained in:
@@ -332,14 +332,12 @@ Future<void> pumpApp(
|
||||
required FakeChannel channel,
|
||||
required PipelinesClient client,
|
||||
required PlatformRouteInformationProvider provider,
|
||||
required bool cupertino,
|
||||
}) async {
|
||||
await tester.pumpWidget(
|
||||
PipelinesApp(
|
||||
androidSupported: false,
|
||||
server: webServer(),
|
||||
client: client,
|
||||
cupertino: cupertino,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
);
|
||||
@@ -373,7 +371,6 @@ void main() {
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: false,
|
||||
);
|
||||
await replyRunList(tester, channel);
|
||||
await replyRunDetail(tester, channel, 2);
|
||||
@@ -439,13 +436,7 @@ void main() {
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await pumpApp(
|
||||
tester,
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: false,
|
||||
);
|
||||
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||
await replyRunList(tester, channel);
|
||||
await replyRunDetail(tester, channel, 2);
|
||||
|
||||
@@ -519,13 +510,7 @@ void main() {
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await pumpApp(
|
||||
tester,
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: false,
|
||||
);
|
||||
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||
await replyRunList(tester, channel);
|
||||
await replyRunDetailFor(tester, channel, searchSelectionDetail());
|
||||
expect(find.text('Run 7'), findsWidgets);
|
||||
@@ -631,13 +616,7 @@ void main() {
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await pumpApp(
|
||||
tester,
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: false,
|
||||
);
|
||||
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||
await replyRunList(tester, channel);
|
||||
|
||||
await tapTab(tester, 'Search');
|
||||
@@ -706,13 +685,7 @@ void main() {
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await pumpApp(
|
||||
tester,
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: false,
|
||||
);
|
||||
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||
await replyRun7List(tester, channel);
|
||||
|
||||
// The hit navigates to run 7, but its detail is never loaded: the operator
|
||||
@@ -763,13 +736,7 @@ void main() {
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await pumpApp(
|
||||
tester,
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: false,
|
||||
);
|
||||
await pumpApp(tester, channel: channel, client: client, provider: provider);
|
||||
await replyRun7List(tester, channel);
|
||||
|
||||
await openArtifactHit(tester, channel);
|
||||
@@ -801,67 +768,6 @@ void main() {
|
||||
await tester.pump();
|
||||
});
|
||||
|
||||
testWidgets('Cupertino Search is a native tab', (tester) async {
|
||||
tester.view.physicalSize = const Size(390, 844);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
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('/runs')),
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
|
||||
await pumpApp(
|
||||
tester,
|
||||
channel: channel,
|
||||
client: client,
|
||||
provider: provider,
|
||||
cupertino: true,
|
||||
);
|
||||
await replyRunList(tester, channel);
|
||||
expect(find.text('Preserved run'), findsWidgets);
|
||||
|
||||
await tapTab(tester, 'Search');
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 600));
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
|
||||
expect(provider.value.uri.path, '/search');
|
||||
expect(find.byKey(const ValueKey('search.field')), findsOneWidget);
|
||||
expect(find.byType(Material), findsNothing);
|
||||
final cupertinoField = tester.widget<EditableText>(
|
||||
find.descendant(
|
||||
of: find.byKey(const ValueKey('search.field')),
|
||||
matching: find.byType(EditableText),
|
||||
),
|
||||
);
|
||||
expect(cupertinoField.focusNode.hasFocus, isTrue);
|
||||
|
||||
await tapTab(tester, 'Runs');
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
|
||||
expect(provider.value.uri.path, '/runs');
|
||||
expect(find.byKey(const ValueKey('search.field')), findsNothing);
|
||||
expect(find.text('Preserved run'), findsWidgets);
|
||||
expect(sockets, 1);
|
||||
|
||||
await tester.pumpWidget(const SizedBox.shrink());
|
||||
await tester.pump();
|
||||
});
|
||||
|
||||
test(
|
||||
'the hit helper never guesses a route for pipeline or malformed hits',
|
||||
() {
|
||||
|
||||
Reference in New Issue
Block a user