Files
bookhoard/bruno/books/Bulk Update Books.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

51 lines
1.2 KiB
Plaintext

{
"meta": {
"name": "Bulk Update Books",
"type": "http",
"event": [
{
"listen": "test",
"script": {
"exec": [
"// Test bulk update response",
"if (response.status === 200) {",
" tests['Bulk update successful'] = true;",
" const body = JSON.parse(response.body);",
" tests['Has results array'] = Array.isArray(body.results);",
" tests['Has total count'] = body.total !== undefined;",
" tests['Has success count'] = body.success !== undefined;",
"} else {",
" tests['Bulk update failed'] = false;",
"}"
]
}
}
]
},
"req": {
"url": "{{baseUrl}}/api/books/bulk-update",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer {{authToken}}"
},
"body": {
"updates": [
{
"book_id": "{{bookId1}}",
"updates": {
"title": "Updated Title",
"genre": "Science Fiction"
}
},
{
"book_id": "{{bookId2}}",
"updates": {
"author": "Updated Author"
}
}
]
}
}
}