meta { name: "Bulk Remove Books from Collection" type: http seq: 1 } # Setup: Create a test collection first post { url: {{baseUrl}}/api/collections body: { name: "Bulk Remove Test Collection" description: "Collection for testing bulk remove" color: "#FF5733" icon: "📚" } assert { res.status: 200 } # Store collection_id from response # Note: In actual Bruno, you'd use variables } # Add some books to the collection post { url: {{baseUrl}}/api/collections/{collection_id}/books body: { book_ids: [ "book-id-1", "book-id-2", "book-id-3" ] } assert { res.status: 204 } } # Test 1: Bulk remove all books post { url: {{baseUrl}}/api/collections/{collection_id}/books/bulk-remove body: { book_ids: [ "book-id-1", "book-id-2", "book-id-3" ] } assert { res.status: 200 res.body.removed: #number res.body.total: 3 } } # Test 2: Bulk remove with some invalid IDs post { url: {{baseUrl}}/api/collections/{collection_id}/books/bulk-remove body: { book_ids: [ "book-id-4", "invalid-id", "book-id-5" ] } assert { res.status: 200 res.body.removed: #number } } # Test 3: Empty list (should fail validation) post { url: {{baseUrl}}/api/collections/{collection_id}/books/bulk-remove body: { book_ids: [] } assert { res.status: 400 } } # Test 4: Single book (bulk remove should work for 1 book too) post { url: {{baseUrl}}/api/collections/{collection_id}/books/bulk-remove body: { book_ids: [ "book-id-6" ] } assert { res.status: 200 res.body.removed: 1 res.body.total: 1 } } # Cleanup: Delete test collection delete { url: {{baseUrl}}/api/collections/{collection_id} assert { res.status: 204 } }