Reserve chat list viewport above labeled navigation
This commit is contained in:
@@ -107,6 +107,60 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('compact focus and execution labels are explicit beyond shapes', (
|
||||
tester,
|
||||
) async {
|
||||
final semantics = tester.ensureSemantics();
|
||||
final gateway = FakeChatGateway()
|
||||
..sessionsReply = {
|
||||
'chat_sessions': [
|
||||
{
|
||||
'id': 'a',
|
||||
'title': 'Active title',
|
||||
'activity': {'turn_running': true, 'seq': 1},
|
||||
},
|
||||
{'id': 'b', 'title': 'Visible title'},
|
||||
],
|
||||
};
|
||||
final controller = ChatSessionsController(
|
||||
ChatRepository(gateway),
|
||||
localStore: MemoryChatSessionLocalStore(),
|
||||
);
|
||||
final folds = ChatSectionFolds();
|
||||
addTearDown(controller.dispose);
|
||||
addTearDown(folds.dispose);
|
||||
addTearDown(gateway.pushed.close);
|
||||
await controller.refresh();
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: ChatCompactSidebar(
|
||||
controller: controller,
|
||||
folds: folds,
|
||||
activeSessionId: 'a',
|
||||
visibleSessionIds: const {'a', 'b'},
|
||||
onOpen: (_) {},
|
||||
onExpand: () {},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
final tips = tester.widgetList<Tooltip>(find.byType(Tooltip));
|
||||
final active = tips
|
||||
.firstWhere((t) => t.message!.startsWith('Active title'))
|
||||
.message!;
|
||||
final visible = tips
|
||||
.firstWhere((t) => t.message!.startsWith('Visible title'))
|
||||
.message!;
|
||||
expect(active, contains('Active chat'));
|
||||
expect(active, contains('Working'));
|
||||
expect(visible, contains('Visible chat'));
|
||||
expect(find.bySemanticsLabel(RegExp('Working')), findsWidgets);
|
||||
expect(find.bySemanticsLabel(RegExp('Visible chat')), findsWidgets);
|
||||
semantics.dispose();
|
||||
});
|
||||
|
||||
for (final cupertino in [false, true]) {
|
||||
for (final brightness in Brightness.values) {
|
||||
testWidgets(
|
||||
|
||||
Reference in New Issue
Block a user