Skip to content

Commit

Permalink
test: refactor logout & delete user tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunny-unik committed Dec 15, 2023
1 parent 601ffc5 commit 1fc0334
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/tests/router.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,17 @@ describe('GET /user', function () {
const response = await agent.get('/user/logout');
expect(response.status).toEqual(200);
expect(response.body.message).toEqual('Logout Successful');
console.log('GET /user/logout success');
});

it('user login then delete success', async function () {
await agent
.post('/user/login')
.send(signupData)
.set('Accept', 'application/json');
const response = await agent
.post('/user/delete')
.send({ userId })
.set('Accept', 'application/json');
const response = await agent.post('/user/delete');
expect(response.status).toEqual(200);
expect(response.body.message).toEqual('User Deleted');
console.log('POST /user/delete success');
});
});

// remaining test cases: [wrong password on login, email is already exists on signup]

0 comments on commit 1fc0334

Please sign in to comment.