-
Notifications
You must be signed in to change notification settings - Fork 74
test: User signup with an existing email #7
Copy link
Copy link
Closed
Labels
good first issueGood for newcomersGood for newcomershacktoberfestIssues marked with this label are part of Hacktoberfest and open for contributionsIssues marked with this label are part of Hacktoberfest and open for contributionstestRequest or propose new test casesRequest or propose new test cases
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershacktoberfestIssues marked with this label are part of Hacktoberfest and open for contributionsIssues marked with this label are part of Hacktoberfest and open for contributionstestRequest or propose new test casesRequest or propose new test cases
Type
Projects
Status
done
Purpose of the Test
This test is needed to cover a critical security and data integrity edge case for the user registration process. It ensures that the system prevents duplicate user accounts from being created with the same email address.
Related Feature/Functionality
POST /api/auth/signupsignupfunction inauthController.jsProposed Test Cases
Current Gaps
The current test suite for authentication (
auth.test.js) only validates the "happy path" or successful user signup. It does not contain any tests for failure scenarios, such as when a user tries to register with an email that already exists.Expected Outcome
The test should confirm that when a
POSTrequest is sent to/api/auth/signupwith an existing email, the API correctly returns a400 Bad Requeststatus code. It should also verify that no new user is created in the database.Additional Notes
backend/__tests__/auth.test.jsfile.