From 1a817a3282d635448ac2350853e8eea64eec448b Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Sat, 26 Jun 2021 13:26:25 +0200 Subject: [PATCH] better device api tests --- .../test/src/core/api/device_api_test.dart | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat/test/src/core/api/device_api_test.dart b/packages/stream_chat/test/src/core/api/device_api_test.dart index f12f04f5..7d4f59fd 100644 --- a/packages/stream_chat/test/src/core/api/device_api_test.dart +++ b/packages/stream_chat/test/src/core/api/device_api_test.dart @@ -26,8 +26,15 @@ void main() { const path = '/devices'; - when(() => client.post(path, data: any(named: 'data'))).thenAnswer( - (_) async => successResponse(path, data: {})); + when(() => client.post( + path, + data: { + 'id': deviceId, + 'push_provider': pushProvider.name, + }, + )) + .thenAnswer( + (_) async => successResponse(path, data: {})); final res = await deviceApi.addDevice(deviceId, pushProvider); @@ -69,7 +76,10 @@ void main() { const path = '/devices'; when( - () => client.delete(path, queryParameters: any(named: 'queryParameters')), + () => client.delete( + path, + queryParameters: {'id': deviceId}, + ), ).thenAnswer((_) async => successResponse(path, data: {})); final res = await deviceApi.removeDevice(deviceId);