@@ -684,6 +684,60 @@ void main() {
684684 verifyNoMoreInteractions (client);
685685 });
686686
687+ test ('markUnread' , () async {
688+ const channelId = 'test-channel-id' ;
689+ const channelType = 'test-channel-type' ;
690+ const messageId = 'test-message-id' ;
691+
692+ final path = '${_getChannelUrl (channelId , channelType )}/unread' ;
693+
694+ when (() => client.post (
695+ path,
696+ data: {'message_id' : messageId},
697+ ))
698+ .thenAnswer (
699+ (_) async => successResponse (path, data: < String , dynamic > {}));
700+
701+ final res = await channelApi.markUnread (
702+ channelId,
703+ channelType,
704+ messageId,
705+ );
706+
707+ expect (res, isNotNull);
708+
709+ verify (() => client.post (path, data: any (named: 'data' ))).called (1 );
710+ verifyNoMoreInteractions (client);
711+ });
712+
713+ test ('markUnreadByTimestamp' , () async {
714+ const channelId = 'test-channel-id' ;
715+ const channelType = 'test-channel-type' ;
716+ final timestamp = DateTime .parse ('2024-01-01T00:00:00Z' );
717+
718+ final path = '${_getChannelUrl (channelId , channelType )}/unread' ;
719+
720+ when (() => client.post (
721+ path,
722+ data: {
723+ 'message_timestamp' : timestamp.toUtc ().toIso8601String (),
724+ },
725+ ))
726+ .thenAnswer (
727+ (_) async => successResponse (path, data: < String , dynamic > {}));
728+
729+ final res = await channelApi.markUnreadByTimestamp (
730+ channelId,
731+ channelType,
732+ timestamp,
733+ );
734+
735+ expect (res, isNotNull);
736+
737+ verify (() => client.post (path, data: any (named: 'data' ))).called (1 );
738+ verifyNoMoreInteractions (client);
739+ });
740+
687741 test ('archiveChannel' , () async {
688742 const channelId = 'test-channel-id' ;
689743 const channelType = 'test-channel-type' ;
0 commit comments