test(e2e): more settings tests (#42046)

This commit is contained in:
Oliver Eyton-Williams
2021-05-07 16:30:38 +02:00
committed by GitHub
parent 94788e2719
commit de40fe86e9
4 changed files with 48 additions and 6 deletions

View File

@ -1,6 +1,7 @@
/* global cy */
describe('Email input field', () => {
before(() => {
beforeEach(() => {
cy.exec('npm run seed');
cy.login();
cy.visit('/settings');
});
@ -17,10 +18,14 @@ describe('Email input field', () => {
cy.get('[id=form-update-email]').within(() => {
cy.contains('Save').click();
});
cy.contains(
'Check your email and click the link we sent you to confirm your new email address.'
);
});
it('Displays an error message when there are problems with the submitted emails', () => {
cy.get('[id=confirm-email]').clear().type('foo@bar.com');
cy.get('[id=new-email]').type('bar@foo.com');
cy.get('[id=confirm-email]').type('foo@bar.com');
cy.get('[class=help-block]').contains(
'Both new email addresses must be the same'