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:
@@ -300,54 +300,48 @@ void main() {
|
||||
);
|
||||
expect(iconWidth(tester, 0), moreOrLessEquals(iconSize));
|
||||
});
|
||||
}
|
||||
|
||||
testWidgets('$host: switching the shell tabs never replays the main '
|
||||
"bar's entrance", (tester) async {
|
||||
animate(tester, on: true);
|
||||
var destination = AppDestination.runs;
|
||||
final shell = StatefulBuilder(
|
||||
builder: (context, setState) => AdaptiveShell(
|
||||
cupertino: cupertino,
|
||||
destination: destination,
|
||||
onDestinationSelected: (value) => setState(() => destination = value),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
cupertino ? CupertinoApp(home: shell) : MaterialApp(home: shell),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
for (final next in [
|
||||
AppDestination.pipelines,
|
||||
AppDestination.chat,
|
||||
AppDestination.runs,
|
||||
]) {
|
||||
await tester.tap(
|
||||
find.byKey(ValueKey('shell.destination.${next.name}')),
|
||||
);
|
||||
for (var frame = 0; frame < 12; frame += 1) {
|
||||
await tester.pump(const Duration(milliseconds: 25));
|
||||
for (final tab in shellTabDestinations) {
|
||||
final finder = find.byKey(
|
||||
ValueKey('shell.destination.${tab.name}'),
|
||||
);
|
||||
testWidgets('switching the shell tabs never replays the main '
|
||||
"bar's entrance", (tester) async {
|
||||
final size = FloatingDestinationBar.buttonSize(cupertino: false);
|
||||
animate(tester, on: true);
|
||||
var destination = AppDestination.runs;
|
||||
final shell = StatefulBuilder(
|
||||
builder: (context, setState) => AdaptiveShell(
|
||||
destination: destination,
|
||||
onDestinationSelected: (value) => setState(() => destination = value),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(MaterialApp(home: shell));
|
||||
await tester.pumpAndSettle();
|
||||
for (final next in [
|
||||
AppDestination.pipelines,
|
||||
AppDestination.chat,
|
||||
AppDestination.runs,
|
||||
]) {
|
||||
await tester.tap(find.byKey(ValueKey('shell.destination.${next.name}')));
|
||||
for (var frame = 0; frame < 12; frame += 1) {
|
||||
await tester.pump(const Duration(milliseconds: 25));
|
||||
for (final tab in shellTabDestinations) {
|
||||
final finder = find.byKey(ValueKey('shell.destination.${tab.name}'));
|
||||
expect(
|
||||
opacityOf(tester, finder),
|
||||
1,
|
||||
reason: '${tab.name} faded switching to ${next.name}',
|
||||
);
|
||||
if (tab != next) {
|
||||
// The previous selection shrinks back to its size; nothing
|
||||
// pops again from 0.6.
|
||||
expect(
|
||||
opacityOf(tester, finder),
|
||||
1,
|
||||
reason: '${tab.name} faded switching to ${next.name}',
|
||||
widthOf(tester, finder),
|
||||
greaterThan(size * 0.9),
|
||||
reason: tab.name,
|
||||
);
|
||||
if (tab != next) {
|
||||
// The previous selection shrinks back to its size; nothing
|
||||
// pops again from 0.6.
|
||||
expect(
|
||||
widthOf(tester, finder),
|
||||
greaterThan(size * 0.9),
|
||||
reason: tab.name,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
});
|
||||
}
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user