test(consultant): verify bottom action stays above system navigation area

This commit is contained in:
2026-10-30 13:31:07 +03:00
parent f58892bdeb
commit 85bc2c6d5c

View File

@@ -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);
});
});
}