Remove obsolete Cupertino fixture coverage

Keep the shared UI primitive tests focused on the app's Material-only behavior and remove alternate-host fixtures that no longer represent supported rendering.
This commit is contained in:
2026-11-11 20:48:02 +00:00
parent 86a8e11438
commit c88a9e8ce8
8 changed files with 111 additions and 192 deletions
@@ -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/shell/adaptive_shell.dart';
@@ -18,31 +17,22 @@ void main() {
const fieldKey = Key('field');
Widget field(bool cupertino) => cupertino
? const CupertinoTextField(key: fieldKey, placeholder: 'Find')
: const TextField(key: fieldKey);
const field = TextField(key: fieldKey);
Rect pillOf(WidgetTester tester, Finder child) => tester.getRect(
find.ancestor(of: child, matching: find.byType(GlassPill)).first,
);
Widget page(bool cupertino, SegmentedBar bar) => cupertino
? CupertinoApp(
home: CupertinoPageScaffold(
navigationBar: bar,
child: const SizedBox.expand(),
),
)
: MaterialApp(
home: Scaffold(
extendBodyBehindAppBar: true,
appBar: bar,
body: const SizedBox.expand(),
),
);
Widget page(SegmentedBar bar) => MaterialApp(
home: Scaffold(
extendBodyBehindAppBar: true,
appBar: bar,
body: const SizedBox.expand(),
),
);
for (final cupertino in [false, true]) {
final host = cupertino ? 'Cupertino' : 'Material';
{
const host = 'Material';
testWidgets('$host: the widget replaces the title and fills a phone bar', (
tester,
@@ -50,11 +40,10 @@ void main() {
setSize(tester, 390);
await tester.pumpWidget(
page(
cupertino,
SegmentedBar(
cupertino: cupertino,
cupertino: false,
title: 'Search',
titleWidget: field(cupertino),
titleWidget: field,
titleWidgetMaxWidth: 840,
),
),
@@ -81,15 +70,11 @@ void main() {
setSize(tester, 1200);
await tester.pumpWidget(
page(
cupertino,
SegmentedBar(
cupertino: cupertino,
cupertino: false,
title: 'Search',
leading: SegmentedBackButton(
cupertino: cupertino,
onPressed: () {},
),
titleWidget: field(cupertino),
leading: SegmentedBackButton(cupertino: false, onPressed: () {}),
titleWidget: field,
titleWidgetMaxWidth: 600,
actions: const [Icon(Icons.info_outline, key: Key('action'))],
),