Verify labeled navigation bounds and scalable targets
This commit is contained in:
@@ -89,11 +89,28 @@ void main() {
|
||||
of: find.byType(FloatingDestinationBar),
|
||||
matching: find.byKey(FloatingDestinationBar.rowKey),
|
||||
);
|
||||
// Sized to its four tabs at the bottom right.
|
||||
// Visible captions determine the width while full-size targets stay inset.
|
||||
final rect = tester.getRect(destinationPill);
|
||||
expect(rect.width, lessThanOrEqualTo(390 - 2 * 16));
|
||||
expect(
|
||||
tester.getSize(destinationPill).width,
|
||||
FloatingDestinationBar.rowWidth(cupertino: cupertino, tabs: 4),
|
||||
tester
|
||||
.widget<FloatingDestinationBar>(find.byType(FloatingDestinationBar))
|
||||
.showLabels,
|
||||
isTrue,
|
||||
);
|
||||
for (final destination in shellTabDestinations) {
|
||||
final caption = find.descendant(
|
||||
of: find.byType(FloatingDestinationBar),
|
||||
matching: find.text(destinationDetails(destination).label),
|
||||
);
|
||||
expect(caption, findsOneWidget);
|
||||
expect(rect.contains(tester.getRect(caption).center), isTrue);
|
||||
final target = tester.getSize(
|
||||
find.byKey(ValueKey('shell.destination.${destination.name}')),
|
||||
);
|
||||
expect(target.width, greaterThanOrEqualTo(44));
|
||||
expect(target.height, greaterThanOrEqualTo(44));
|
||||
}
|
||||
expect(tester.getRect(destinationPill).right, 390 - 16);
|
||||
await tester.tap(find.byKey(const ValueKey('shell.destination.chat')));
|
||||
await tester.pump();
|
||||
|
||||
Reference in New Issue
Block a user