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,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -53,17 +52,14 @@ JsonMap noRun() => {'type': 'run', 'run_detail': null};
|
||||
Future<void> pumpScreen(
|
||||
WidgetTester tester,
|
||||
FakeGateway gateway,
|
||||
List<int> navigated, {
|
||||
bool cupertino = false,
|
||||
}) async {
|
||||
List<int> navigated,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(1100, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
final screen = PipelinesScreen(gateway: gateway, onRunStarted: navigated.add);
|
||||
await tester.pumpWidget(
|
||||
cupertino ? CupertinoApp(home: screen) : MaterialApp(home: screen),
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(home: screen));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
@@ -582,74 +578,6 @@ void main() {
|
||||
expect(navigated, [86]);
|
||||
});
|
||||
|
||||
testWidgets('the Cupertino host shows the same native prompt and words', (
|
||||
tester,
|
||||
) async {
|
||||
final fixture = PipelineFixture();
|
||||
final navigated = <int>[];
|
||||
final gateway = launchGateway(
|
||||
fixture,
|
||||
onLaunch: (fields) => acceptedRun(84),
|
||||
);
|
||||
await pumpScreen(tester, gateway, navigated, cupertino: true);
|
||||
await openDetail(tester);
|
||||
await tester.tap(find.byKey(runPipelineActionKey));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byType(CupertinoAlertDialog), findsOneWidget);
|
||||
expect(find.byType(AlertDialog), findsNothing);
|
||||
expect(find.text('Run Alpha review'), findsOneWidget);
|
||||
expect(find.text(runPipelinePromptLabel), findsOneWidget);
|
||||
expect(find.text(runPipelineWorkspaceLabel), findsOneWidget);
|
||||
expect(find.text(runPipelineNotifyLabel), findsOneWidget);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byType(CupertinoAlertDialog),
|
||||
matching: find.text(runPipelineConfirmLabel),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text(runPipelineCancelLabel), findsOneWidget);
|
||||
expect(gateway.callsOf('run_pipeline'), isEmpty);
|
||||
|
||||
await tester.tap(find.byKey(runPipelineCancelKey));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(CupertinoAlertDialog), findsNothing);
|
||||
expect(gateway.callsOf('run_pipeline'), isEmpty);
|
||||
});
|
||||
|
||||
testWidgets('Cupertino field labels and helper use theme label roles', (
|
||||
tester,
|
||||
) async {
|
||||
final fixture = PipelineFixture();
|
||||
final gateway = launchGateway(
|
||||
fixture,
|
||||
onLaunch: (fields) => acceptedRun(87),
|
||||
);
|
||||
await pumpScreen(tester, gateway, <int>[], cupertino: true);
|
||||
await openDetail(tester);
|
||||
await tester.tap(find.byKey(runPipelineActionKey));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final context = tester.element(find.byType(CupertinoAlertDialog));
|
||||
final theme = CupertinoTheme.of(context);
|
||||
final labelStyle = theme.textTheme.textStyle;
|
||||
for (final label in [
|
||||
runPipelinePromptLabel,
|
||||
runPipelineWorkspaceLabel,
|
||||
runPipelineNotifyLabel,
|
||||
]) {
|
||||
final style = tester.widget<Text>(find.text(label)).style;
|
||||
expect(style?.color, labelStyle.color, reason: label);
|
||||
expect(style?.fontSize, labelStyle.fontSize, reason: label);
|
||||
}
|
||||
final helper = tester
|
||||
.widget<Text>(find.text(runPipelineWorkspaceHelper))
|
||||
.style;
|
||||
expect(helper?.color, CupertinoColors.secondaryLabel.resolveFrom(context));
|
||||
expect(helper?.fontSize, theme.textTheme.tabLabelTextStyle.fontSize);
|
||||
});
|
||||
|
||||
testWidgets('Schedule… leaves the run dialog for the schedule editor', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in New Issue
Block a user