From 16d11de9773f2316079f4e1ff804eaf8493dc321 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 14 Mar 2018 14:41:29 +0300 Subject: [PATCH] Added e2e test for attempt to open direct register page with invalid refresh token state --- .../integration/invalid-refreshToken.test.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests-e2e/cypress/integration/invalid-refreshToken.test.js b/tests-e2e/cypress/integration/invalid-refreshToken.test.js index 72e305e..89c5fa9 100644 --- a/tests-e2e/cypress/integration/invalid-refreshToken.test.js +++ b/tests-e2e/cypress/integration/invalid-refreshToken.test.js @@ -228,6 +228,27 @@ describe('when user\'s token and refreshToken are invalid', () => { cy.url().should('contain', '/register'); }); + /** + * This is a regression test for the edge case, when user tries to register new + * account via direct sign up page link + * + * Expected result: + * It should show register page + * + * Actual result: + * User was redirected from register page back to password page due to recursive + * atempt to get new refreshToken + * + * @see https://trello.com/c/iINbZ2l2 + */ + it('should allow enter register page', () => { + cy.visit('/register'); + + cy.get('@fetch').should('be.calledWith', '/api/options'); + + cy.url().should('contain', '/register'); + }); + it('should allow oauth', () => { cy.visit( '/oauth2/v1/ely?client_id=ely&redirect_uri=http%3A%2F%2Fely.by%2Fauthorization%2Foauth&response_type=code&scope=account_info%2Caccount_email'