Skip to content

Commit 29adc7b

Browse files
dougborgclaude
authored andcommitted
Add JsonLineParser test for detection event type
Verify that flock-you format events with event:"detection" pass through the parser alongside the existing target_detected coverage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 665e481 commit 29adc7b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/services/json_line_parser_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ void main() {
138138
expect(parser.events.first['event'], 'target_detected');
139139
});
140140

141+
test('detection event is emitted', () {
142+
final json = jsonEncode(makeFlockyouDetectionJson());
143+
parser.processBytes(_encode('$json\n'));
144+
145+
expect(parser.events, hasLength(1));
146+
expect(parser.events.first['event'], 'detection');
147+
});
148+
141149
test('other event types are ignored', () {
142150
final json = jsonEncode(makeDetectionJson(event: 'status_update'));
143151
parser.processBytes(_encode('$json\n'));

0 commit comments

Comments
 (0)