fix: Password reset page shows blank username#10534
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
📝 WalkthroughWalkthroughThe password reset HTML templates (default, German, and Austrian German locales) were updated to conditionally render the "for your account: {{username}}" portion using a Mustache-style conditional block instead of always displaying it. Corresponding spec tests were added to verify both cases. ChangesPassword Reset Username Conditional
Estimated code review effort: 1 (Trivial) | ~5 minutes PoemA bunny hopped through pages three, 🚥 Pre-merge checks | ✅ 4 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10534 +/- ##
=======================================
Coverage 92.66% 92.66%
=======================================
Files 193 193
Lines 16981 16981
Branches 248 248
=======================================
Hits 15736 15736
Misses 1224 1224
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
spec/PagesRouter.spec.js (1)
312-329: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueUse
passwordReset()in both tests for symmetry.The "omits username" test exercises
goToPage()directly instead ofpasswordReset(), unlike the sibling test. Since the actual bug (and this PR's fix) is scoped topasswordReset()buildingparams.usernamefromreq.query.username, testing via the real handler in both cases would more faithfully validate the fix and keep the two tests symmetric.♻️ Suggested alignment
it('omits the username clause on the password reset page when no username is set', async () => { - await expectAsync(router.goToPage(req, pages.passwordReset)).toBeResolved(); + req.params = { appId: config.appId }; + await expectAsync(router.passwordReset(req)).toBeResolved();🤖 Prompt for 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. In `@spec/PagesRouter.spec.js` around lines 312 - 329, The password reset spec is asymmetric: the “omits username” case calls router.goToPage() directly instead of exercising router.passwordReset() like the sibling test. Update that test to invoke router.passwordReset(req) so both cases validate the same handler path that builds params.username from req.query.username, keeping the assertions on pageResponse and replacedContent aligned.
🤖 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.
Nitpick comments:
In `@spec/PagesRouter.spec.js`:
- Around line 312-329: The password reset spec is asymmetric: the “omits
username” case calls router.goToPage() directly instead of exercising
router.passwordReset() like the sibling test. Update that test to invoke
router.passwordReset(req) so both cases validate the same handler path that
builds params.username from req.query.username, keeping the assertions on
pageResponse and replacedContent aligned.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4cbb3152-97f7-4ca1-a22a-cb4048930547
📒 Files selected for processing (4)
public/de-AT/password_reset.htmlpublic/de/password_reset.htmlpublic/password_reset.htmlspec/PagesRouter.spec.js
Closes #10245
Summary by CodeRabbit
Bug Fixes
Tests