Skip to content

Commit fdfd43a

Browse files
committed
test: add more tests
1 parent b344ade commit fdfd43a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/stream_chat/test/src/client/channel_test.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,26 @@ void main() {
11541154
cancelToken: any(named: 'cancelToken'))).called(1);
11551155
});
11561156

1157+
test('`.stopAIResponse`', () async {
1158+
final stopAIEvent = Event(type: EventType.aiIndicatorStop);
1159+
1160+
when(() => client.sendEvent(
1161+
channelId,
1162+
channelType,
1163+
any(that: isSameEventAs(stopAIEvent)),
1164+
)).thenAnswer((_) async => EmptyResponse());
1165+
1166+
final res = await channel.stopAIResponse();
1167+
1168+
expect(res, isNotNull);
1169+
1170+
verify(() => client.sendEvent(
1171+
channelId,
1172+
channelType,
1173+
any(that: isSameEventAs(stopAIEvent)),
1174+
)).called(1);
1175+
});
1176+
11571177
test('`.sendEvent`', () async {
11581178
final event = Event(type: 'event.local');
11591179

0 commit comments

Comments
 (0)