-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(okta): switch from
sid
cookie to idx
cookie in tests and…
… documentation
- Loading branch information
Showing
12 changed files
with
69 additions
and
59 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
describe('Okta Register flow', () => { | ||
const setSidCookie = () => { | ||
cy.setCookie('sid', `the_sid_cookie`, { | ||
const setIdxCookie = () => { | ||
cy.setCookie('idx', `the_idx_cookie`, { | ||
domain: Cypress.env('BASE_URI'), | ||
}); | ||
}; | ||
|
@@ -14,7 +14,7 @@ describe('Okta Register flow', () => { | |
cy.disableCMP(); | ||
}); | ||
|
||
it('should redirect to homepage if the sid Okta session cookie is valid', () => { | ||
it('should redirect to homepage if the idx Okta session cookie is valid', () => { | ||
cy.mockPattern( | ||
200, | ||
{ | ||
|
@@ -40,7 +40,7 @@ describe('Okta Register flow', () => { | |
|
||
cy.visit('/register'); | ||
|
||
setSidCookie(); | ||
setIdxCookie(); | ||
|
||
cy.get('input[name="email"]').type('[email protected]'); | ||
cy.mockNext(200, { | ||
|
@@ -71,12 +71,12 @@ describe('Okta Register flow', () => { | |
cy.contains('Sign in with a different email'); | ||
}); | ||
|
||
it('should redirect to /reauthenticate if the sid Okta session cookie is set, but invalid', () => { | ||
it('should redirect to /reauthenticate if the idx Okta session cookie is set, but invalid', () => { | ||
cy.mockPattern(404, '/api/v1/sessions/me'); | ||
|
||
cy.mockPattern(204, {}, '/api/v1/users/userId/sessions'); | ||
|
||
setSidCookie(); | ||
setIdxCookie(); | ||
|
||
// visit healthcheck to set the cookie | ||
cy.visit('/healthcheck'); | ||
|
@@ -85,15 +85,15 @@ describe('Okta Register flow', () => { | |
|
||
cy.location('pathname').should('eq', '/reauthenticate'); | ||
|
||
cy.getCookie('sid').should('not.exist'); | ||
cy.getCookie('idx').should('not.exist'); | ||
}); | ||
}); | ||
|
||
context('Signed in user visits /register', () => { | ||
beforeEach(() => { | ||
cy.mockPurge(); | ||
}); | ||
it('should redirect to homepage if the sid Okta session cookie is valid', () => { | ||
it('should redirect to homepage if the idx Okta session cookie is valid', () => { | ||
cy.mockPattern( | ||
200, | ||
{ | ||
|
@@ -115,7 +115,7 @@ describe('Okta Register flow', () => { | |
|
||
cy.mockPattern(204, {}, '/api/v1/users/userId/sessions'); | ||
|
||
setSidCookie(); | ||
setIdxCookie(); | ||
|
||
// disable the cmp on the redirect | ||
cy.disableCMP(); | ||
|
@@ -138,12 +138,12 @@ describe('Okta Register flow', () => { | |
cy.contains('Sign in with a different email'); | ||
}); | ||
|
||
it('should redirect to /reauthenticate if the sid Okta session cookie is set but invalid', () => { | ||
it('should redirect to /reauthenticate if the idx Okta session cookie is set but invalid', () => { | ||
cy.mockPattern(404, '/api/v1/sessions/me'); | ||
|
||
cy.mockPattern(204, {}, '/api/v1/users/userId/sessions'); | ||
|
||
setSidCookie(); | ||
setIdxCookie(); | ||
|
||
// visit healthcheck to set the cookie | ||
cy.visit('/healthcheck'); | ||
|
@@ -152,7 +152,7 @@ describe('Okta Register flow', () => { | |
|
||
cy.location('pathname').should('eq', '/reauthenticate'); | ||
|
||
cy.getCookie('sid').should('not.exist'); | ||
cy.getCookie('idx').should('not.exist'); | ||
}); | ||
}); | ||
}); |
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
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
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
Oops, something went wrong.