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'

View File

@ -1,8 +1,15 @@
/* global cy */
/* global cy expect */
describe('Settings', () => {
it('should be possible to visit the settings page', () => {
it('should be possible to reset your progress', () => {
cy.visit('/');
cy.contains("Get started (it's free)").click({ force: true });
cy.contains("Get started (it's free)").click();
cy.visit('/settings');
cy.contains('Reset all of my progress').click();
cy.contains('Reset everything. I want to start from the beginning').click();
cy.location().should(loc => {
expect(loc.pathname).to.eq('/');
});
cy.contains('Your progress has been reset');
});
});