Remove Cupertino template branches

Keep the Material-only template implementation and narrow its tests to the runtime path. Retain public Cupertino parameters for compatibility while removing unreachable hosts, widgets, and test variants.
This commit is contained in:
2026-11-11 02:53:23 +00:00
parent 42cb6a6f2d
commit 1db273894c
16 changed files with 302 additions and 613 deletions
@@ -1,13 +1,11 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/core/transport/connection_state.dart';
import 'package:pipelines_app/features/templates/ui/template_create_wording.dart';
import '../data/template_test_support.dart' show source;
import 'template_create_test_support.dart';
void main() {
@@ -107,65 +105,4 @@ void main() {
findsOneWidget,
);
});
testWidgets('cupertino prompt uses native controls for the same flow', (
tester,
) async {
final gateway = FakeTemplateCreateGateway(
(type, fields) async => type == 'validate'
? {'graph': {}}
: {
'detail': {'id': 3},
},
);
final created = <JsonMap>[];
await tester.pumpWidget(
templateCreateApp(
TemplateCreateHost(
gateway: gateway,
onCreated: created.add,
cupertino: true,
),
cupertino: true,
),
);
await tester.tap(find.byKey(templateCreateOpenKey));
await tester.pumpAndSettle();
expect(find.byType(CupertinoAlertDialog), findsOneWidget);
expect(find.byType(AlertDialog), findsNothing);
expect(find.byType(CupertinoTextField), findsOneWidget);
expect(find.text(templateCreateNameLabel), findsOneWidget);
expect(cupertinoTemplateName(tester), '');
expect(
tester
.widget<CupertinoDialogAction>(find.byKey(templateCreateConfirmKey))
.onPressed,
isNull,
);
await tester.enterText(find.byKey(templateCreateNameKey), ' Unicode 🚀 ');
await tester.pump();
await tester.tap(find.byKey(templateCreateConfirmKey));
await tester.pumpAndSettle();
expect(gateway.calls.map((call) => call.type), ['validate', 'submit']);
expect(gateway.calls[1].fields, {
'name': 'Unicode 🚀',
'source': source,
'create_only': true,
});
expect(
find.text('Created "Unicode 🚀". It is in the Pipelines list.'),
findsOneWidget,
);
expect(created.single, {'id': 3});
expect(
tester
.widget<CupertinoTextField>(find.byKey(templateCreateNameKey))
.enabled,
isFalse,
);
expect(find.text('Close'), findsOneWidget);
});
}