From e100a0f7b25381c13d897b9b1beaf2cf38770a79 Mon Sep 17 00:00:00 2001 From: rushtong Date: Sat, 14 Sep 2024 08:01:31 -0400 Subject: [PATCH] feat: test cleanup --- .../component/SignIn/sign_in_button.spec.js | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/cypress/component/SignIn/sign_in_button.spec.js b/cypress/component/SignIn/sign_in_button.spec.js index cdade4e48..6fdf7e391 100644 --- a/cypress/component/SignIn/sign_in_button.spec.js +++ b/cypress/component/SignIn/sign_in_button.spec.js @@ -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: 'test@user.com', @@ -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: 'test@user.com'}; 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');