better device api tests
This commit is contained in:
@@ -26,8 +26,15 @@ void main() {
|
|||||||
|
|
||||||
const path = '/devices';
|
const path = '/devices';
|
||||||
|
|
||||||
when(() => client.post(path, data: any(named: 'data'))).thenAnswer(
|
when(() => client.post(
|
||||||
(_) async => successResponse(path, data: <String, dynamic>{}));
|
path,
|
||||||
|
data: {
|
||||||
|
'id': deviceId,
|
||||||
|
'push_provider': pushProvider.name,
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.thenAnswer(
|
||||||
|
(_) async => successResponse(path, data: <String, dynamic>{}));
|
||||||
|
|
||||||
final res = await deviceApi.addDevice(deviceId, pushProvider);
|
final res = await deviceApi.addDevice(deviceId, pushProvider);
|
||||||
|
|
||||||
@@ -69,7 +76,10 @@ void main() {
|
|||||||
const path = '/devices';
|
const path = '/devices';
|
||||||
|
|
||||||
when(
|
when(
|
||||||
() => client.delete(path, queryParameters: any(named: 'queryParameters')),
|
() => client.delete(
|
||||||
|
path,
|
||||||
|
queryParameters: {'id': deviceId},
|
||||||
|
),
|
||||||
).thenAnswer((_) async => successResponse(path, data: <String, dynamic>{}));
|
).thenAnswer((_) async => successResponse(path, data: <String, dynamic>{}));
|
||||||
|
|
||||||
final res = await deviceApi.removeDevice(deviceId);
|
final res = await deviceApi.removeDevice(deviceId);
|
||||||
|
|||||||
Reference in New Issue
Block a user