Phase 12 - Bruno API Tests Standardization Convert all custom section builder tests to .yml format: - preview-collection.bru → preview-collection.yml - create-custom-section-manual.bru → create-custom-section-manual.yml - create-custom-section-missing-fields.bru → create-custom-section-missing-fields.yml - create-custom-section-rules.bru → create-custom-section-rules.yml All Bruno tests now consistently use .yml extension across the project. Tests cover: - Preview collection with filter rules - Create collection with manual book selection - Validation of required fields - Multiple filter rules with operators Part of Carousel Dashboard Plan completion
24 lines
686 B
YAML
24 lines
686 B
YAML
meta:
|
|
name: Create Custom Section Missing Required Fields
|
|
type: http
|
|
seq: 3
|
|
http:
|
|
method: POST
|
|
url: '{{base_url}}/api/collections'
|
|
auth: inherit
|
|
body:
|
|
type: json
|
|
jsonBody: "{\n \"library_id\": \"{{library_id}}\",\n \"icon\": \"📚\"\
|
|
\n}"
|
|
runtime:
|
|
scripts:
|
|
- type: tests
|
|
code: "test(\"status must be 400 with missing name\", function() {\n expect(res.status).to.eql(400);\n\
|
|
});\n\ntest(\"response contains error message\", function() {\n expect(res.body.error).to.exist;\n\
|
|
\ });"
|
|
|
|
docs: |-
|
|
Test error handling when creating a collection without required fields.
|
|
|
|
**Expected Response**: 400 Bad Request with error message.
|