Keep chat activity stable in one live disclosure and distinguish unread attention
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/chat/ui/sessions/session_attention.dart';
|
||||
|
||||
void main() {
|
||||
test('only final turn end clears working; a background shell cannot', () {
|
||||
for (final status in ['started', 'streamed', 'running', 'streaming']) {
|
||||
final effect = chatSessionFrameEffect({
|
||||
'type': 'chat_event',
|
||||
'chat_event': {
|
||||
'session_id': 's',
|
||||
'kind': 'step',
|
||||
'step': {'status': status},
|
||||
},
|
||||
});
|
||||
expect(effect!.running, isTrue);
|
||||
expect(effect.attention, isFalse);
|
||||
}
|
||||
for (final kind in ['shell', 'compaction']) {
|
||||
final effect = chatSessionFrameEffect({
|
||||
'type': 'chat_event',
|
||||
'chat_event': {
|
||||
'session_id': 's',
|
||||
'kind': kind,
|
||||
kind: {'status': kind == 'shell' ? 'exited' : 'completed'},
|
||||
},
|
||||
});
|
||||
expect(effect!.running, isNull);
|
||||
expect(effect.attention, isFalse);
|
||||
}
|
||||
final intermediate = chatSessionFrameEffect({
|
||||
'type': 'chat_event',
|
||||
'chat_event': {
|
||||
'session_id': 's',
|
||||
'kind': 'step',
|
||||
'step': {'status': 'ended', 'intermediate': true},
|
||||
},
|
||||
});
|
||||
expect(intermediate!.running, isNull);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user