Skip to content

Instantly share code, notes, and snippets.

@doque
Last active October 1, 2019 10:01
Show Gist options
  • Save doque/7cb204e0c251bee8040a926c29dee7f2 to your computer and use it in GitHub Desktop.
Save doque/7cb204e0c251bee8040a926c29dee7f2 to your computer and use it in GitHub Desktop.
it('shows an error message when the auth service responds with 422', () => {
cy.server();
cy.route({
method: 'POST',
url: '**/auth/forgotPassword/change',
// url: 'https://auth.foo.com/auth/forgotPassword/change',
status: 422,
delay: 3000,
}).as('resetPassword');
cy.visit('/');
cy.xpath('//input[@type="password"]').type('abc123');
cy.xpath('//input[@type="submit"]').click({ force: true });
cy.wait('@resetPassword');
cy.get('@resetPassword')
.its('status')
.should('eq', 422);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment