better message api tests

This commit is contained in:
Salvatore Giordano
2021-06-26 13:37:40 +02:00
parent ff8ff6d7ce
commit 9857db0635
4 changed files with 139 additions and 35 deletions
@@ -989,11 +989,11 @@ class Channel {
/// List the reactions for a message in the channel
Future<QueryReactionsResponse> getReactions(
String messageId, {
PaginationParams? options,
PaginationParams? pagination,
}) =>
_client.getReactions(
messageId,
options: options,
pagination: pagination,
);
/// Retrieves a list of messages by ID
@@ -1149,11 +1149,11 @@ class StreamChatClient {
/// Get all the reactions for a [messageId]
Future<QueryReactionsResponse> getReactions(
String messageId, {
PaginationParams? options,
PaginationParams? pagination,
}) =>
_chatApi.message.getReactions(
messageId,
options: options,
pagination: pagination,
);
/// Update the given message
@@ -143,12 +143,12 @@ class MessageApi {
/// Get all the reactions for a [messageId]
Future<QueryReactionsResponse> getReactions(
String messageId, {
PaginationParams? options,
PaginationParams? pagination,
}) async {
final response = await _client.get(
'/messages/$messageId/reactions',
queryParameters: {
if (options != null) ...options.toJson(),
if (pagination != null) ...pagination.toJson(),
},
);
return QueryReactionsResponse.fromJson(response.data);