Skip to content

Commit

Permalink
register user testing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisegithub committed May 4, 2024
1 parent c2822cc commit 2c206c4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/__test__/userController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ describe('User Registration Tests', () => {
});

it('should return a 409 status code if the email already exists', async () => {
// Setup: Ensure a user with the specified email exists
const existingUserData = {
firstName: 'Existing',
lastName: 'User',
email: 'test@gmail.com',
password: 'ExistingPassword123',
userType: 'buyer',
};
await request(app).post('/api/v1/register').send(existingUserData);

// Test: Attempt to register a new user with the same email
const userData = {
firstName: 'Existing',
lastName: 'User',
Expand Down

0 comments on commit 2c206c4

Please sign in to comment.