-
-
Notifications
You must be signed in to change notification settings - Fork 931
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): implement recovery tests for SPA
- Loading branch information
Showing
7 changed files
with
124 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 35 additions & 34 deletions
69
test/e2e/cypress/integration/profiles/recovery/recovery/success.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
test/e2e/cypress/integration/profiles/recovery/settings/success.spec.js
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
test/e2e/cypress/integration/profiles/recovery/settings/success.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import {assertRecoveryAddress, gen} from '../../../../helpers' | ||
import {routes as react} from "../../../../helpers/react"; | ||
import {routes as express} from "../../../../helpers/express"; | ||
|
||
context('Account Recovery Success', () => { | ||
[ | ||
{ | ||
settings: react.settings, | ||
base: react.base, | ||
app: 'react', profile: 'spa' | ||
}, | ||
{ | ||
settings: express.settings, | ||
base: express.base, | ||
app: 'express', profile: 'recovery' | ||
} | ||
].forEach(({settings, profile, base, app}) => { | ||
describe(`for app ${app}`, () => { | ||
before(() => { | ||
cy.deleteMail() | ||
cy.useConfigProfile(profile) | ||
}) | ||
|
||
let identity | ||
|
||
beforeEach(() => { | ||
cy.deleteMail() | ||
cy.longRecoveryLifespan() | ||
cy.longLinkLifespan() | ||
cy.disableVerification() | ||
cy.enableRecovery() | ||
|
||
identity = gen.identityWithWebsite() | ||
cy.registerApi(identity) | ||
cy.login({...identity, cookieUrl: base}) | ||
}) | ||
|
||
it('should update the recovery address when updating the email', () => { | ||
cy.visit(settings) | ||
const email = gen.email() | ||
cy.get('input[name="traits.email"]').clear().type(email) | ||
cy.get('button[value="profile"]').click() | ||
cy.expectSettingsSaved() | ||
cy.get('input[name="traits.email"]').should('contain.value', email) | ||
|
||
cy.getSession().should(assertRecoveryAddress({email})) | ||
}) | ||
|
||
xit('should not show an immediate error when a recovery address already exists', () => { | ||
// account enumeration prevention, needs to be implemented. | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters