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

Aditya-Added-Testing-for-Login #2734

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Conversation

adityasure9
Copy link
Contributor

Description

This PR introduces unit tests for the Login component, focusing on testing the structure of the login page, handling user input, and ensuring correct login behavior. These tests cover input field changes, form validation, and the submission process to ensure that the Login component functions as expected.

Main changes explained:

  • Created Login.test.jsx to introduce unit tests for the Login component.
  • Tested the structure of the login page, ensuring correct rendering of inputs, buttons, and headers.
  • Simulated user interactions such as typing into input fields and submitting the login form.
  • Validated form submission logic, ensuring the correct function (loginUser) is called with the right credentials.
  • Checked if errors are properly handled and displayed when form inputs are invalid or incomplete.

How to test:

  1. Check into the current branch.
  2. Run npm install to install dependencies.
  3. Run npm test Login.test.jsx to execute the unit tests.
  4. Ensure all tests pass, including structure validation, input handling, and login behavior.

Screenshots or videos of changes:

image

Copy link

netlify bot commented Sep 28, 2024

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit f602ef4
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/66f77ce6f6cad5000897744d
😎 Deploy Preview https://deploy-preview-2734--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Lexie5212 Lexie5212 self-requested a review September 28, 2024 04:05
Copy link
Contributor

@Lexie5212 Lexie5212 left a comment

Choose a reason for hiding this comment

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

I tested the PR, all tests passed!
Screenshot 2024-09-27 at 21 04 51

Copy link
Contributor

@jinxyou jinxyou left a comment

Choose a reason for hiding this comment

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

All test case have passed. Great work
Screenshot 2024-09-27 211308

Copy link
Contributor

@ziyanw52 ziyanw52 left a comment

Choose a reason for hiding this comment

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

I have test this, and all the test cases passed.
571727502471_ pic_hd

Copy link

@linkhanthtel linkhanthtel left a comment

Choose a reason for hiding this comment

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

All test cases passed as expected! Nice work!

#2734

Copy link

@Vincent-space Vincent-space left a comment

Choose a reason for hiding this comment

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

Hi, I tested all cases, all of them passed.
image

Copy link
Contributor

@Nahiyan-16 Nahiyan-16 left a comment

Choose a reason for hiding this comment

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

Hi Aditya, great job on the initial tests for the Login page! Your tests are well-organized and cover important features like the page layout, input handling, and login actions. Using both shallow and mount rendering helps get more accurate results by simulating the component behavior properly. The focus on error handling and updating the state, especially for form validation and submission, is excellent and makes your tests more reliable. Overall, these tests are a strong start for ensuring the Login page works correctly.

Screenshot 2024-09-28 131135

Copy link

@Dk-21 Dk-21 left a comment

Choose a reason for hiding this comment

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

PR 2734
@adityasure9
Tested the test file and all the test cases passed.
PR 2734

Copy link

@ishangoel17 ishangoel17 left a comment

Choose a reason for hiding this comment

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

All test cases are passing. Below is the screenshot for reference:
Capture2734

Copy link

@Watchdog00 Watchdog00 left a comment

Choose a reason for hiding this comment

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

I have completed the testing and got the expected results. Good job!
#2734

Copy link

@Muzammil603 Muzammil603 left a comment

Choose a reason for hiding this comment

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

image
Results as expected

aaryaneil

This comment was marked as off-topic.

@mianmiantea2019
Copy link
Member

All test cases are passing

image

@tharunaa-1
Copy link

All the test cases passed.

image

Copy link

@Vigneshwar-Muriki Vigneshwar-Muriki left a comment

Choose a reason for hiding this comment

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

Tested this PR and all test cases passed successfully.

#2734

Copy link

@Vincent-space Vincent-space left a comment

Choose a reason for hiding this comment

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

Hi, all test cases passed.
image

Copy link

@nikhilpittala16 nikhilpittala16 left a comment

Choose a reason for hiding this comment

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

I have tested the PR and all the test cases have passed.
Screenshot (218)

@geetamatkar
Copy link

I tested this PR. All test cases have passed.

PR2734

@mianmiantea2019
Copy link
Member

All test cases have passed.

image

Copy link
Contributor

@manikittu810 manikittu810 left a comment

Choose a reason for hiding this comment

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

Hello @adityasure9
Everything is working as mentioned.
Screenshot 2024-10-18 at 10 12 17 AM

Thank you.

@SatyashanthiT
Copy link
Contributor

I have reviewed this PR, which introduces unit tests for the Login component. The tests effectively cover key areas such as input handling, form validation, and login behavior. After running the tests as outlined, everything works as expected, with no issues detected during the review process.
image

@one-community
Copy link
Member

Thank you all, merging!

@one-community one-community merged commit 4b7d09c into development Nov 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.