updated tests
This commit is contained in:
@@ -226,7 +226,7 @@ describe('Auth Integration Tests', () => {
|
||||
})
|
||||
.expect(401);
|
||||
|
||||
expect(response.body.error).toBe('Unable to log in. Please check your email and password, or create an account.');
|
||||
expect(response.body.error).toBe('Please check your email and password, or create an account.');
|
||||
});
|
||||
|
||||
it('should reject login with non-existent email', async () => {
|
||||
@@ -238,7 +238,7 @@ describe('Auth Integration Tests', () => {
|
||||
})
|
||||
.expect(401);
|
||||
|
||||
expect(response.body.error).toBe('Unable to log in. Please check your email and password, or create an account.');
|
||||
expect(response.body.error).toBe('Please check your email and password, or create an account.');
|
||||
});
|
||||
|
||||
it('should increment login attempts on failed login', async () => {
|
||||
@@ -255,8 +255,8 @@ describe('Auth Integration Tests', () => {
|
||||
});
|
||||
|
||||
it('should lock account after too many failed attempts', async () => {
|
||||
// Make 5 failed login attempts
|
||||
for (let i = 0; i < 5; i++) {
|
||||
// Make 10 failed login attempts (MAX_LOGIN_ATTEMPTS is 10)
|
||||
for (let i = 0; i < 10; i++) {
|
||||
await request(app)
|
||||
.post('/auth/login')
|
||||
.send({
|
||||
@@ -265,7 +265,7 @@ describe('Auth Integration Tests', () => {
|
||||
});
|
||||
}
|
||||
|
||||
// 6th attempt should return locked error
|
||||
// 11th attempt should return locked error
|
||||
const response = await request(app)
|
||||
.post('/auth/login')
|
||||
.send({
|
||||
|
||||
Reference in New Issue
Block a user