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,49 @@
|
||||
{
|
||||
"meta": {
|
||||
"name": "Bulk Add Books to Collections",
|
||||
"type": "http",
|
||||
"event": [
|
||||
{
|
||||
"listen": "test",
|
||||
"script": {
|
||||
"exec": [
|
||||
"// Test bulk add to collections response",
|
||||
"if (response.status === 200) {",
|
||||
" tests['Bulk add successful'] = true;",
|
||||
" const body = JSON.parse(response.body);",
|
||||
" tests['Has results array'] = Array.isArray(body.results);",
|
||||
" tests('All operations processed', body.results.length > 0);",
|
||||
"} else {",
|
||||
" tests['Bulk add failed'] = false;",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"req": {
|
||||
"url": "{{baseUrl}}/api/collections/bulk-add-books",
|
||||
"method": "POST",
|
||||
"headers": {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": "Bearer {{authToken}}"
|
||||
},
|
||||
"body": {
|
||||
"operations": [
|
||||
{
|
||||
"collection_id": "{{collectionId1}}",
|
||||
"book_ids": [
|
||||
"{{bookId1}}",
|
||||
"{{bookId2}}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"collection_id": "{{collectionId2}}",
|
||||
"book_ids": [
|
||||
"{{bookId3}}"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user