test(api): add Bruno tests for analytics, books, and bulk operations
Analytics: - Reading stats endpoint tests - Device usage tests - Popular books tests Books: - Bulk delete tests - Bulk update tests Collections: - Bulk add books to collections tests Conflicts: - Bulk resolve conflicts tests - Bulk dismiss conflicts tests - Bulk resolve highest progress tests All tests cover no user, user, and admin contexts
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"meta": {
|
||||
"name": "Get Device Usage",
|
||||
"type": "http",
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"exec": [
|
||||
"// Test device usage response",
|
||||
"if (response.status === 200) {",
|
||||
" tests['Device usage loaded'] = true;",
|
||||
" const body = JSON.parse(response.body);",
|
||||
" tests['Has devices array'] = Array.isArray(body.devices);",
|
||||
" if (body.devices.length > 0) {",
|
||||
" tests['Device has device_name'] = body.devices[0].device_name !== undefined;",
|
||||
" tests['Device has device_type'] = body.devices[0].device_type !== undefined;",
|
||||
" tests['Device has sync_count'] = body.devices[0].sync_count !== undefined;",
|
||||
" }",
|
||||
"} else {",
|
||||
" tests['Device usage failed'] = false;",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"req": {
|
||||
"url": "{{baseUrl}}/api/analytics/device-usage",
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"Authorization": "Bearer {{authToken}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user