From 2acfaf7a7c0afc15f502f1b7eff92017c00e4856 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 23 Jul 2021 15:12:52 +0530 Subject: [PATCH] test(llc): re-add removed tests Signed-off-by: xsahil03x --- .../core/http/stream_http_client_test.dart | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/stream_chat/test/src/core/http/stream_http_client_test.dart b/packages/stream_chat/test/src/core/http/stream_http_client_test.dart index af3cabc0..7860a0d6 100644 --- a/packages/stream_chat/test/src/core/http/stream_http_client_test.dart +++ b/packages/stream_chat/test/src/core/http/stream_http_client_test.dart @@ -87,6 +87,30 @@ void main() { ); }); + test('loggingInterceptor should log requests', () async { + const apiKey = 'api-key'; + final logger = MockLogger(); + final client = StreamHttpClient(apiKey, logger: logger); + + try { + await client.get('path'); + } catch (_) {} + + verify(() => logger.info(any())).called(greaterThan(0)); + }); + + test('loggingInterceptor should log error', () async { + const apiKey = 'api-key'; + final logger = MockLogger(); + final client = StreamHttpClient(apiKey, logger: logger); + + try { + await client.get('path'); + } catch (_) {} + + verify(() => logger.severe(any())).called(greaterThan(0)); + }); + test('`.lock` should lock the dio client', () async { final client = StreamHttpClient('api-key'); expect(client.httpClient.interceptors.requestLock.locked, isFalse);