Skip to content
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

fix:included + sign in email for forgot password link 30195 #36241

Conversation

MajaharZemoso
Copy link

@MajaharZemoso MajaharZemoso commented Sep 11, 2024

Issue 30195

Description

  • Used encodeURIComponent to encode the email while passing it to query parameters for the reset password page, ensuring the + sign is not removed.

  • Added Cypress test cases to verify correct handling of special characters in email addresses.

Screenshots

image
image

Summary by CodeRabbit

  • New Features

    • Introduced an end-to-end test for the password reset flow, ensuring proper navigation and handling of special characters in email addresses.
    • Added unit tests for the Login component to validate the "Forgot password" feature and URL updates based on user input.
  • Bug Fixes

    • Enhanced URL safety by encoding special characters in the email address during password reset URL generation.

Copy link
Contributor

coderabbitai bot commented Sep 11, 2024

Walkthrough

This update introduces a new Cypress end-to-end test for the password reset flow, ensuring that the application correctly handles email inputs with special characters. Additionally, the Login component's URL generation for password recovery has been modified to use encodeURIComponent, enhancing URL safety. A new test suite for the Login component has also been added, focusing on the "Forgot password" feature and verifying that the email input updates the corresponding URL correctly.

Changes

File Change Summary
app/client/cypress/e2e/Regression/ClientSide/FormLogin/forgotPasswordEmailSpecialChar_spec.ts Added Cypress test for password reset flow, verifying email input handling with special characters.
app/client/src/pages/UserAuth/Login.tsx Modified forgotPasswordURL construction to use encodeURIComponent for safer URL generation.
app/client/src/pages/tests/Login.test.tsx Introduced unit tests for Login component, validating "Forgot password" feature and URL updates based on email input.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LoginPage
    participant PasswordResetPage

    User->>LoginPage: Logs out
    User->>LoginPage: Enters email with special characters
    User->>LoginPage: Clicks "Forgot Password"
    LoginPage->>PasswordResetPage: Navigates with encoded email
    PasswordResetPage->>User: Displays password reset instructions
Loading

🎉 In code we trust, with tests so bright,
Special characters handled, all feels right.
A flow for reset, now safe and sound,
In the realm of login, new tests abound!
Let's celebrate this code, with joy and cheer,
For every change made, brings us near! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@MajaharZemoso MajaharZemoso changed the title Fix/included + sign in email for forgot password link 30195 fix/included + sign in email for forgot password link 30195 Sep 11, 2024
@MajaharZemoso MajaharZemoso changed the title fix/included + sign in email for forgot password link 30195 fix:included + sign in email for forgot password link 30195 Sep 11, 2024
const email = "[email protected]";
const forgotPasswordClassName = ".sc-hoaEDx > .sc-lknQiW > .sc-bcXHqe";
const emailPlaceholder = `[placeholder="Enter your email"]`;
it("Should navigate to reset password page with the correct email", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need here cypress test case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To try with both unit test cases and Cypress I have added both things in PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sagar-qa007 based on your suggestion, I have removed the Cypress test for this particular fix. Could you please review it again when you have a moment? Thank you!

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Sep 20, 2024
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants