Merge pull request #565 from GetStream/fix/channel-stop-watching

This commit is contained in:
Sahil Kumar
2021-07-21 15:32:08 +05:30
committed by GitHub
2 changed files with 3 additions and 2 deletions
@@ -289,6 +289,7 @@ class ChannelApi {
) async {
final response = await _client.post(
'${_getChannelUrl(channelId, channelType)}/stop-watching',
data: {},
);
return EmptyResponse.fromJson(response.data);
}
@@ -595,14 +595,14 @@ void main() {
final path = '${_getChannelUrl(channelId, channelType)}/stop-watching';
when(() => client.post(path)).thenAnswer(
when(() => client.post(path, data: {})).thenAnswer(
(_) async => successResponse(path, data: <String, dynamic>{}));
final res = await channelApi.stopWatching(channelId, channelType);
expect(res, isNotNull);
verify(() => client.post(path)).called(1);
verify(() => client.post(path, data: {})).called(1);
verifyNoMoreInteractions(client);
});
}