Keep enlarged chat header controls reachable in short viewports
This commit is contained in:
@@ -38,6 +38,47 @@ void _useNarrowText(WidgetTester tester) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
testWidgets('short large-text header scrolls controls without overflow', (
|
||||
tester,
|
||||
) async {
|
||||
_useNarrowText(tester);
|
||||
await tester.pumpWidget(
|
||||
_host(
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: SizedBox(
|
||||
width: 320,
|
||||
height: 100,
|
||||
child: ChatThreadHeader(
|
||||
title: _title,
|
||||
folder: 'demo',
|
||||
onInfo: () {},
|
||||
showBack: true,
|
||||
onBack: () {},
|
||||
controls: [
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
child: const Text('Current model'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
child: const Text('Ask for permission'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
cupertino: false,
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.ensureVisible(find.text('Ask for permission'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Ask for permission').hitTestable(), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
for (final cupertino in [false, true]) {
|
||||
final host = cupertino ? 'Cupertino' : 'Material';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user