fix(llc): fix truncate channel payload

This commit is contained in:
Salvatore Giordano
2022-01-18 10:48:42 +01:00
parent b36c4f1f7a
commit 3c9f87ea2b
2 changed files with 11 additions and 3 deletions
@@ -266,6 +266,7 @@ class ChannelApi {
) async {
final response = await _client.post(
'${_getChannelUrl(channelId, channelType)}/truncate',
data: {},
);
return EmptyResponse.fromJson(response.data);
}
@@ -483,14 +483,21 @@ void main() {
final path = '${_getChannelUrl(channelId, channelType)}/truncate';
when(() => client.post(path)).thenAnswer(
(_) async => successResponse(path, data: <String, dynamic>{}));
when(() => client.post(
path,
data: {},
))
.thenAnswer(
(_) async => successResponse(path, data: <String, dynamic>{}));
final res = await channelApi.truncateChannel(channelId, channelType);
expect(res, isNotNull);
verify(() => client.post(path)).called(1);
verify(() => client.post(
path,
data: {},
)).called(1);
verifyNoMoreInteractions(client);
});