From ddf33a19897641d874dd716e500565887e5b235a Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Thu, 19 Aug 2021 17:50:37 +0530 Subject: [PATCH] added tests --- .../test/src/api/channel_test.dart | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/stream_chat/test/src/api/channel_test.dart b/packages/stream_chat/test/src/api/channel_test.dart index 6afa60c2..08ebd091 100644 --- a/packages/stream_chat/test/src/api/channel_test.dart +++ b/packages/stream_chat/test/src/api/channel_test.dart @@ -1860,15 +1860,17 @@ void main() { }); test('`.enableSlowMode`', () async { + const cooldown = 10; + final channelModel = ChannelModel( cid: channelCid, - cooldown: 10, + cooldown: cooldown, ); when(() => client.enableSlowdown( - channelCid, + channelId, channelType, - 10, + cooldown, )).thenAnswer((_) async => PartialUpdateChannelResponse() ..channel = channelModel); @@ -1877,32 +1879,28 @@ void main() { expect(res, isNotNull); verify(() => client.enableSlowdown( - channelCid, + channelId, channelType, - any(), + cooldown, )).called(1); }); test('`.disableSlowMode`', () async { final channelModel = ChannelModel( cid: channelCid, - cooldown: 0, ); when(() => client.disableSlowdown( - channelCid, - channelType, - )).thenAnswer((_) async => PartialUpdateChannelResponse() + channelId, + channelType, + )).thenAnswer((_) async => PartialUpdateChannelResponse() ..channel = channelModel); final res = await channel.disableSlowMode(); expect(res, isNotNull); - verify(() => client.disableSlowdown( - channelCid, - channelType, - )).called(1); + verify(() => client.disableSlowdown(channelId, channelType)).called(1); }); test('`.banUser`', () async {