diff --git a/test/api/route/messages_test.dart b/test/api/route/messages_test.dart index 472895b18d..2cb174e1cb 100644 --- a/test/api/route/messages_test.dart +++ b/test/api/route/messages_test.dart @@ -454,6 +454,35 @@ void main() { }); }); + group('markTopicAsRead', () { + Future checkMarkTopicAsRead( + FakeApiConnection connection, { + required int streamId, + required String topicName, + required Map expected, + }) async { + connection.prepare(json: {}); + await markTopicAsRead(connection, + streamId: streamId, topicName: topicName); + check(connection.lastRequest).isNotNull().isA() + ..method.equals('POST') + ..url.path.equals('/api/v1/mark_topic_as_read') + ..bodyFields.deepEquals(expected); + } + + test('smoke', () { + return FakeApiConnection.with_((connection) async { + await checkMarkTopicAsRead(connection, + streamId: 10, + topicName: 'topic', + expected: { + 'stream_id': '10', + 'topic_name': 'topic', + }); + }); + }); + }); + group('updateMessageFlags', () { Future checkUpdateMessageFlags( FakeApiConnection connection, {