better device api tests

This commit is contained in:
Salvatore Giordano
2021-06-26 13:26:25 +02:00
parent 9cc6ef124c
commit 1a817a3282
@@ -26,8 +26,15 @@ void main() {
const path = '/devices';
when(() => client.post(path, data: any(named: 'data'))).thenAnswer(
(_) async => successResponse(path, data: <String, dynamic>{}));
when(() => client.post(
path,
data: {
'id': deviceId,
'push_provider': pushProvider.name,
},
))
.thenAnswer(
(_) async => successResponse(path, data: <String, dynamic>{}));
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: <String, dynamic>{}));
final res = await deviceApi.removeDevice(deviceId);