Merge: chat colours, Ctrl+1-9, starred chats alphabetical
# Conflicts: # app/lib/features/chat/conversation/chat_thread_view.dart # app/tool/perf/perf_fixture.dart # internal/protocol/chat.go # internal/server/chat_close.go # internal/server/chat_sessions.go
This commit is contained in:
@@ -65,37 +65,43 @@ void main() {
|
||||
await gateway.controller.close();
|
||||
});
|
||||
|
||||
test('notifies titled and unknown sessions; tap opens the chat route', () async {
|
||||
gateway.controller.add(_event());
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
gateway.controller.add(_event(id: 'form-2', session: 'unknown'));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
test(
|
||||
'notifies titled and unknown sessions; tap opens the chat route',
|
||||
() async {
|
||||
gateway.controller.add(_event());
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
gateway.controller.add(_event(id: 'form-2', session: 'unknown'));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
|
||||
expect(bridge.shown.map((message) => message.title), [
|
||||
'Design chat needs your answer',
|
||||
'Chat needs your answer',
|
||||
]);
|
||||
expect(bridge.shown.first.body, 'Choose an option');
|
||||
expect(bridge.shown.first.tag, 'chat-question:form-1');
|
||||
bridge.taps.first?.call();
|
||||
expect(opened, [AppRoute.chatSession('session_1')]);
|
||||
});
|
||||
expect(bridge.shown.map((message) => message.title), [
|
||||
'Design chat needs your answer',
|
||||
'Chat needs your answer',
|
||||
]);
|
||||
expect(bridge.shown.first.body, 'Choose an option');
|
||||
expect(bridge.shown.first.tag, 'chat-question:form-1');
|
||||
bridge.taps.first?.call();
|
||||
expect(opened, [AppRoute.chatSession('session_1')]);
|
||||
},
|
||||
);
|
||||
|
||||
test('suppresses active, unavailable, resolved, cancelled and non-question frames', () async {
|
||||
active = 'session_1';
|
||||
gateway.controller.add(_event());
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
active = null;
|
||||
allowed = false;
|
||||
gateway.controller.add(_event(id: 'form-2'));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
allowed = true;
|
||||
gateway.controller.add(_event(id: 'form-3', resolved: true));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
gateway.controller.add(_event(id: 'form-4', cancelled: true));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
gateway.controller.add(_event(id: 'form-5', kind: 'approval'));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(bridge.shown, isEmpty);
|
||||
});
|
||||
test(
|
||||
'suppresses active, unavailable, resolved, cancelled and non-question frames',
|
||||
() async {
|
||||
active = 'session_1';
|
||||
gateway.controller.add(_event());
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
active = null;
|
||||
allowed = false;
|
||||
gateway.controller.add(_event(id: 'form-2'));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
allowed = true;
|
||||
gateway.controller.add(_event(id: 'form-3', resolved: true));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
gateway.controller.add(_event(id: 'form-4', cancelled: true));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
gateway.controller.add(_event(id: 'form-5', kind: 'approval'));
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
expect(bridge.shown, isEmpty);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user