-
Notifications
You must be signed in to change notification settings - Fork 280
test: implement tests for application update functionality #2562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: anuj/application-edit-functionality
Are you sure you want to change the base?
test: implement tests for application update functionality #2562
Conversation
- Added integration tests for the PATCH /applications/:applicationId endpoint, covering various scenarios including successful updates, validation errors, and authorization checks. - Enhanced unit tests for the applications controller to validate update logic and error handling. - Introduced validation tests for application update data to ensure proper request structure and content. - Updated application model tests to verify correct behavior for update operations under different conditions.
Summary by CodeRabbit
WalkthroughThis PR adds comprehensive test coverage for the PATCH /applications/:applicationId endpoint across integration, controller, middleware, and model layers. Tests verify successful updates, authorization checks, ownership validation, 24-hour edit conflict detection, and field validation rules. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
…in application update
|
@coderabbitai bro review, please go easy on @AnujChhikara |
|
Let me dive into the changes and provide helpful feedback. 🚀 ✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@test/integration/application.test.ts`:
- Around line 359-427: The tests mutate applicationId1 in the first "should
return 200..." case which sets lastEditAt and causes later PATCH validation
tests to get 409 Conflict; fix by isolating tests—either create a fresh
application for each PATCH test or switch the validation tests to use a
different pre-seeded app (e.g., applicationId2 with superUserJwt), update the
tests in the "PATCH /applications/:applicationId" describe block to use the new
application id or create a new application within each it() before sending the
PATCH so the 24-hour edit restriction does not interfere.
Date: 30 Jan 2026
Developer Name: @AnujChhikara
Issue Ticket Number
Description
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes