fix(ci): update api.md and uploadPhoto tests to fix CI test failures - #1949
fix(ci): update api.md and uploadPhoto tests to fix CI test failures#1949Dev-Mayuresh wants to merge 2 commits into
Conversation
|
@Dev-Mayuresh is attempting to deploy a commit to the durdana3105's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe PR updates upload tests for user-scoped URLs and a 2 MB size limit. It documents both upload endpoints, accepted upload types, and magic-byte validation. ChangesUpload validation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/tests/uploadPhoto.test.js`:
- Line 170: Update the uploadPhoto test assertion around res.body.fileUrl to
parse the URL and verify TEST_USER_ID appears as a pathname segment immediately
beneath the profiles bucket, rather than using a broad toContain check that can
match unrelated URL content.
In `@docs/api.md`:
- Around line 133-140: Expand the POST /api/upload and POST
/api/users/upload-photo entries in the API documentation to specify required
authentication, multipart form fields, permitted folder values for the generic
upload, and each response field. Document that generic uploads return data.url,
profile-photo uploads return fileUrl, and profile photos are limited to 2 MiB.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a12f5032-d968-4e4d-ab43-5be8ab777c12
📒 Files selected for processing (2)
backend/tests/uploadPhoto.test.jsdocs/api.md
…to path assertion
Description
This PR fixes #1940 the failing CI tests on GitHub Actions.
What caused the test failures?
Missing documentation (
docs/api.md):The test file
docs.test.jschecks if backend routes are documented. It was failing because the/api/uploadand/api/users/upload-photoendpoints were missing fromdocs/api.md.Outdated test rules (
uploadPhoto.test.js):Changes Made
/api/uploadand/api/users/upload-photoindocs/api.md.uploadPhoto.test.jsto match the correct 2MB limit and correct user file URL format.Verification
Ran both CI test commands locally:
Full Suite with Coverage:
Summary by CodeRabbit
Documentation
Tests