Files
pipelines/app/test/features/chat/ui/sessions/session_attention_test.dart
T

41 lines
1.2 KiB
Dart

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);
});
}