test(serve): strengthen POST /ui contract coverage#242
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe changes expand ChangesUI endpoint contract and behavior validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related Issue
Closes #216
Changes
Test Result
# start server task build:ui task build:cli ./bin/vizb serveCase 1
curl -sS http://127.0.0.1:8080/ui \ -H 'Content-Type: application/json' \ -H 'Accept: text/html' \ --data '{ "datasets": { "name": "Local UI test", "axes": [ {"key":"x","label":"Region"}, {"key":"y","label":"Latency","type":"value"} ], "settings": [{"type":"line","smooth":false}], "data": [ {"xAxis":"west","yAxis":"12"}, {"xAxis":"east","yAxis":"18"} ] }, "charts": { "types": ["line"], "configs": [{"type":"line","smooth":true,"showLabels":true}] } }' \ -o /tmp/vizb-report.htmlCase 2
curl -i http://127.0.0.1:8080/ui \ -H 'Content-Type: application/json' \ -H 'Accept: text/html' \ --data '{ "datasets": { "name": "Remote test", "axes": [], "settings": [], "data": [] }, "dataUrl": "https://example.com/data.json" }' HTTP/1.1 422 Unprocessable Entity Content-Type: application/problem+json Date: Sun, 19 Jul 2026 16:06:07 GMT Content-Length: 264 {"detail":"Request validation failed.","errors":[{"location":"body","path":"/","code":"invalid_json","message":"json: unknown field \"dataUrl\""}],"instance":"/ui","status":422,"title":"Unprocessable content","type":"https://vizb.goptics.org/problems/validation"}Case 3
curl -i http://127.0.0.1:8080/ui \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ --data '{ "datasets": { "name": "Accept test", "axes": [], "settings": [], "data": [] } }' \HTTP/1.1 406 Not Acceptable Content-Type: application/problem+json Date: Sun, 19 Jul 2026 16:06:46 GMT Content-Length: 154 {"detail":"Accept must allow text/html","instance":"/ui","status":406,"title":"Not acceptable","type":"https://vizb.goptics.org/problems/not-acceptable"}Summary by CodeRabbit