You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CI test suite in GitHub Actions has been failing during automated test runs due to missing endpoint documentation in docs/api.md and outdated test expectations in backend/tests/uploadPhoto.test.js.
Steps to Reproduce
Run npx vitest run in the project root.
Observe test failures in backend/tests/docs.test.js and backend/tests/uploadPhoto.test.js.
Root Cause
backend/tests/docs.test.js asserts that all production API endpoints and upload validation rules are documented in docs/api.md. The /api/upload and /api/users/upload-photo endpoints, along with magic-byte validation specs, were missing from docs/api.md.
Bug Description
The CI test suite in GitHub Actions has been failing during automated test runs due to missing endpoint documentation in
docs/api.mdand outdated test expectations inbackend/tests/uploadPhoto.test.js.Steps to Reproduce
npx vitest runin the project root.backend/tests/docs.test.jsandbackend/tests/uploadPhoto.test.js.Root Cause
backend/tests/docs.test.jsasserts that all production API endpoints and upload validation rules are documented indocs/api.md. The/api/uploadand/api/users/upload-photoendpoints, along with magic-byte validation specs, were missing fromdocs/api.md.backend/tests/uploadPhoto.test.jscontained obsolete test assertions expecting a 5MB upload size limit (reduced to 2MB in PR Severe Security: Remote Code Execution via Unrestricted File Upload in Profile Assets #1850) and an outdatedfileUrlregex format.Impact
GitHub Actions CI test runs fail on pull requests and main branch commits, blocking valid PR integrations and deployment pipelines.
Proposed Fix
docs/api.mdto document/api/upload,/api/users/upload-photo, and their associated magic byte and preset validation rules.backend/tests/uploadPhoto.test.jsassertions to reflect the 2MB photo size limit and correct user-scopedfileUrlpathing.