Update error messages for login tests

This commit is contained in:
Cameron Hutchison 2024-12-11 16:46:20 -06:00
parent d714feeab8
commit 46f0b52509

View File

@ -67,7 +67,7 @@ describe('Login', () => {
// Expect a 401 from the backend // Expect a 401 from the backend
cy.get('@login').its('response.statusCode').should('eq', 401); cy.get('@login').its('response.statusCode').should('eq', 401);
// Expect an error message on the UI // Expect an error message on the UI
cy.get('div[data-cy="password-error"]').should('contain.text', 'Invalid password'); cy.get('div[data-cy="password-error"]').should('contain.text', 'Invalid email or password');
}); });
it('should show an error message if the email is incorrect', () => { it('should show an error message if the email is incorrect', () => {
@ -85,7 +85,7 @@ describe('Login', () => {
// Expect a 401 from the backend // Expect a 401 from the backend
cy.get('@login').its('response.statusCode').should('eq', 401); cy.get('@login').its('response.statusCode').should('eq', 401);
// Expect an error message on the UI // Expect an error message on the UI
cy.get('div[data-cy="password-error"]').should('contain.text', 'No relevant user found'); cy.get('div[data-cy="password-error"]').should('contain.text', 'Invalid email or password');
}); });
}); });
}); });
@ -150,7 +150,7 @@ describe('Login', () => {
// Expect a 401 from the backend // Expect a 401 from the backend
cy.get('@login').its('response.statusCode').should('eq', 401); cy.get('@login').its('response.statusCode').should('eq', 401);
// Expect an error message on the UI // Expect an error message on the UI
cy.get('div[data-cy="password-error"]').should('contain.text', 'Invalid password'); cy.get('div[data-cy="password-error"]').should('contain.text', 'Invalid email or password');
}); });
it('should show an error message if the email is incorrect', () => { it('should show an error message if the email is incorrect', () => {
@ -168,7 +168,7 @@ describe('Login', () => {
// Expect a 401 from the backend // Expect a 401 from the backend
cy.get('@login').its('response.statusCode').should('eq', 401); cy.get('@login').its('response.statusCode').should('eq', 401);
// Expect an error message on the UI // Expect an error message on the UI
cy.get('div[data-cy="password-error"]').should('contain.text', 'No relevant user found'); cy.get('div[data-cy="password-error"]').should('contain.text', 'Invalid email or password');
}); });
}); });