Merge branch 'master' into feat/pin-message

This commit is contained in:
Salvatore Giordano
2021-02-19 16:17:38 +01:00
committed by GitHub
5 changed files with 71 additions and 1 deletions
@@ -992,5 +992,37 @@ void main() {
});
});
});
group('channel', () {
test('should update channel', () async {
final mockDio = MockDio();
when(mockDio.options).thenReturn(BaseOptions());
when(mockDio.interceptors).thenReturn(Interceptors());
final client = StreamChatClient(
'api-key',
httpClient: mockDio,
);
final channelClient =
client.channel('type', id: 'id', extraData: {'name': 'init'});
var update = {
'set': {'name': 'demo'}
};
when(mockDio.patch<String>(
'/channels/${channelClient.type}/${channelClient.id}',
data: update,
)).thenAnswer((_) async => Response(data: '{}', statusCode: 200));
await channelClient.updatePartial(update);
verify(mockDio.patch<String>(
'/channels/${channelClient.type}/${channelClient.id}',
data: update))
.called(1);
});
});
});
}