fix(llc): fix truncate channel payload
This commit is contained in:
@@ -266,6 +266,7 @@ class ChannelApi {
|
|||||||
) async {
|
) async {
|
||||||
final response = await _client.post(
|
final response = await _client.post(
|
||||||
'${_getChannelUrl(channelId, channelType)}/truncate',
|
'${_getChannelUrl(channelId, channelType)}/truncate',
|
||||||
|
data: {},
|
||||||
);
|
);
|
||||||
return EmptyResponse.fromJson(response.data);
|
return EmptyResponse.fromJson(response.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -483,14 +483,21 @@ void main() {
|
|||||||
|
|
||||||
final path = '${_getChannelUrl(channelId, channelType)}/truncate';
|
final path = '${_getChannelUrl(channelId, channelType)}/truncate';
|
||||||
|
|
||||||
when(() => client.post(path)).thenAnswer(
|
when(() => client.post(
|
||||||
(_) async => successResponse(path, data: <String, dynamic>{}));
|
path,
|
||||||
|
data: {},
|
||||||
|
))
|
||||||
|
.thenAnswer(
|
||||||
|
(_) async => successResponse(path, data: <String, dynamic>{}));
|
||||||
|
|
||||||
final res = await channelApi.truncateChannel(channelId, channelType);
|
final res = await channelApi.truncateChannel(channelId, channelType);
|
||||||
|
|
||||||
expect(res, isNotNull);
|
expect(res, isNotNull);
|
||||||
|
|
||||||
verify(() => client.post(path)).called(1);
|
verify(() => client.post(
|
||||||
|
path,
|
||||||
|
data: {},
|
||||||
|
)).called(1);
|
||||||
verifyNoMoreInteractions(client);
|
verifyNoMoreInteractions(client);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user