fix(app): chat conversation bar leads, outside the transcript scroller
This commit is contained in:
@@ -278,7 +278,19 @@ void main() {
|
||||
final control = find.byKey(
|
||||
const ValueKey<String>('chat-activity-toggle'),
|
||||
);
|
||||
await tester.ensureVisible(control);
|
||||
// Drag like an operator: a programmatic scroll is undone by the
|
||||
// view's follow-to-latest, while a user drag stops following.
|
||||
final list = find.byKey(const ValueKey<String>('chat-thread-s'));
|
||||
final viewport = tester.getRect(list);
|
||||
for (var i = 0; i < 10; i++) {
|
||||
final rect = tester.getRect(control);
|
||||
if (rect.top >= viewport.top && rect.bottom <= viewport.bottom) break;
|
||||
await tester.drag(
|
||||
list,
|
||||
Offset(0, rect.top < viewport.top ? 200 : -200),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
await tester.tap(control);
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
@@ -579,4 +579,25 @@ void main() {
|
||||
expect(find.text('Background tasks'), findsOneWidget);
|
||||
expect(find.text('1 running'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('the conversation bar leads, above the task bar', (tester) async {
|
||||
final gateway = _TasksGateway();
|
||||
gateway.shells = () async => _snapshot([_running('sh1')]);
|
||||
addTearDown(gateway.close);
|
||||
|
||||
await tester.pumpWidget(_thread(gateway));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final header = tester.getRect(find.byKey(const Key('chat-thread-header')));
|
||||
final tasks = tester.getRect(
|
||||
find.byKey(const Key('chat-background-tasks')),
|
||||
);
|
||||
final list = tester.getRect(
|
||||
find.byKey(const ValueKey<String>('chat-thread-s')),
|
||||
);
|
||||
expect(header.top, 0);
|
||||
expect(tasks.top, greaterThanOrEqualTo(header.bottom));
|
||||
// The bar sits outside the transcript's scroller, as the web's chat-bar.
|
||||
expect(list.top, greaterThanOrEqualTo(tasks.bottom));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user