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:
@@ -11,62 +11,52 @@ import 'template_gallery_test_support.dart';
|
||||
/// Settings reading width, start-aligned; the bar names the open template and
|
||||
/// the Create action is a compact button, not a full-width bar.
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
final host = cupertino ? 'Cupertino' : 'Material';
|
||||
testWidgets('rows and detail are capped at 720 on a wide window', (
|
||||
tester,
|
||||
) async {
|
||||
final gateway = GalleryGateway(
|
||||
(type, fields) async => templatesReply(galleryTemplates),
|
||||
);
|
||||
await pumpGallery(tester, gateway, size: const Size(1200, 800));
|
||||
|
||||
testWidgets('$host: rows and detail are capped at 720 on a wide window', (
|
||||
final row = tester.getRect(find.byKey(templateRowKey('release')));
|
||||
expect(row.left, 0);
|
||||
expect(row.width, templatesContentMaxWidth);
|
||||
expect(find.text('Templates'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(templateRowKey('release')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final bar = find.byType(SegmentedBar);
|
||||
expect(
|
||||
find.descendant(of: bar, matching: find.text('Release workflow')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('Templates'), findsNothing);
|
||||
|
||||
final create = tester.getRect(find.byKey(templateCreateActionKey));
|
||||
expect(create.left, 16);
|
||||
// Its own width, not stretched across the 688 content column.
|
||||
expect(create.width, lessThan(templatesContentMaxWidth - 32));
|
||||
final body = tester.getRect(selectableSource(source));
|
||||
expect(body.right, lessThanOrEqualTo(templatesContentMaxWidth));
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('the detail fits 320 at 2x text', (tester) async {
|
||||
final gateway = GalleryGateway(
|
||||
(type, fields) async => templatesReply(galleryTemplates),
|
||||
);
|
||||
await pumpGallery(
|
||||
tester,
|
||||
) async {
|
||||
final gateway = GalleryGateway(
|
||||
(type, fields) async => templatesReply(galleryTemplates),
|
||||
);
|
||||
await pumpGallery(
|
||||
tester,
|
||||
gateway,
|
||||
cupertino: cupertino,
|
||||
size: const Size(1200, 800),
|
||||
);
|
||||
|
||||
final row = tester.getRect(find.byKey(templateRowKey('release')));
|
||||
expect(row.left, 0);
|
||||
expect(row.width, templatesContentMaxWidth);
|
||||
expect(find.text('Templates'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(templateRowKey('release')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final bar = find.byType(SegmentedBar);
|
||||
expect(
|
||||
find.descendant(of: bar, matching: find.text('Release workflow')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.text('Templates'), findsNothing);
|
||||
|
||||
final create = tester.getRect(find.byKey(templateCreateActionKey));
|
||||
expect(create.left, 16);
|
||||
// Its own width, not stretched across the 688 content column.
|
||||
expect(create.width, lessThan(templatesContentMaxWidth - 32));
|
||||
final body = tester.getRect(selectableSource(source));
|
||||
expect(body.right, lessThanOrEqualTo(templatesContentMaxWidth));
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('$host: the detail fits 320 at 2x text', (tester) async {
|
||||
final gateway = GalleryGateway(
|
||||
(type, fields) async => templatesReply(galleryTemplates),
|
||||
);
|
||||
await pumpGallery(
|
||||
tester,
|
||||
gateway,
|
||||
cupertino: cupertino,
|
||||
size: const Size(320, 800),
|
||||
textScale: 2,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.tap(find.byKey(templateRowKey('release')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(templateCreateActionKey), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
gateway,
|
||||
size: const Size(320, 800),
|
||||
textScale: 2,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.tap(find.byKey(templateRowKey('release')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(templateCreateActionKey), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user