Files
bookhoard/bruno/analytics/Get Device Usage.bru
T
john-okeefe 2df5ca3325 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
2026-02-01 12:16:07 -05:00

36 lines
1.1 KiB
Plaintext

{
"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}}"
}
}
}