forked from eatvio/eatvio_app
test(consultant): verify bottom action stays above system navigation area
This commit is contained in:
@@ -16,5 +16,29 @@ void main() {
|
||||
expect(find.byType(BecomeConsultantScreen), findsOneWidget);
|
||||
expect(find.text('Стать консультантом'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('keeps the bottom action above the system navigation area', (tester) async {
|
||||
const bottomInset = 34.0;
|
||||
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: ThemeHelper().themeData(),
|
||||
builder: (context, child) => MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(padding: const EdgeInsets.only(bottom: bottomInset)),
|
||||
child: child!,
|
||||
),
|
||||
home: const BecomeConsultantScreen(),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final buttonRect = tester.getRect(
|
||||
find.ancestor(of: find.text('Начать регистрацию'), matching: find.byType(Ink)).first,
|
||||
);
|
||||
final viewHeight = tester.view.physicalSize.height / tester.view.devicePixelRatio;
|
||||
|
||||
expect(buttonRect.bottom, lessThanOrEqualTo(viewHeight - bottomInset));
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user