-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,30 +9,10 @@ import {Storage} from '../../../src/libs/storage'; | |
import {Metrics} from '../../../src/libs/ajax/Metrics'; | ||
import {StackdriverReporter} from '../../../src/libs/stackdriverReporter'; | ||
import {ToS} from '../../../src/libs/ajax/ToS'; | ||
import {oidcUser} from '../Auth/oidcUser'; | ||
|
||
const signInText = 'Sign In'; | ||
|
||
const claims = { | ||
jti: undefined, nbf: undefined, sub: undefined, | ||
iss: '', | ||
aud: '', | ||
exp: 0, | ||
iat: 0 | ||
}; | ||
|
||
const user = { | ||
access_token: '', get expires_in() { | ||
return undefined; | ||
}, session_state: undefined, state: undefined, token_type: '', get expired() { | ||
return undefined; | ||
}, get scopes() { | ||
return []; | ||
}, toStorageString() { | ||
return ''; | ||
}, | ||
profile: claims | ||
}; | ||
|
||
const duosUser = { | ||
displayName: 'display name', | ||
email: '[email protected]', | ||
|
@@ -59,7 +39,7 @@ describe('Sign In: Component Loads', function() { | |
|
||
it('Sign In: On Success', function () { | ||
cy.viewport(600, 300); | ||
cy.stub(Auth, 'signIn').returns(Promise.resolve(user)); | ||
cy.stub(Auth, 'signIn').returns(Promise.resolve(oidcUser)); | ||
cy.stub(User, 'getMe').returns(duosUser); | ||
cy.stub(StackdriverReporter, 'report'); | ||
cy.stub(Metrics, 'identify'); | ||
|
@@ -80,7 +60,7 @@ describe('Sign In: Component Loads', function() { | |
it('Sign In: No Roles Error Reporter Is Called', function () { | ||
const bareUser = {email: '[email protected]'}; | ||
cy.viewport(600, 300); | ||
cy.stub(Auth, 'signIn').returns(Promise.resolve(user)); | ||
cy.stub(Auth, 'signIn').returns(Promise.resolve(oidcUser)); | ||
cy.stub(User, 'getMe').returns(bareUser); | ||
cy.stub(StackdriverReporter, 'report'); | ||
cy.stub(Metrics, 'identify'); | ||
|