X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f17cabd0672f80de53186d42855aacba482b4ccf..d4afb5d44f63394461ff1571039a74b3462d8ae6:/src/store/auth/auth-action.test.ts diff --git a/src/store/auth/auth-action.test.ts b/src/store/auth/auth-action.test.ts index f28ae1790c..801d9e33ee 100644 --- a/src/store/auth/auth-action.test.ts +++ b/src/store/auth/auth-action.test.ts @@ -21,8 +21,9 @@ import 'jest-localstorage-mock'; import { createServices } from "~/services/services"; import { configureStore, RootStore } from "../store"; import createBrowserHistory from "history/createBrowserHistory"; -import { Config, mockConfig } from '~/common/config'; +import { mockConfig } from '~/common/config'; import { ApiActions } from "~/services/api/api-actions"; +import { ACCOUNT_LINK_STATUS_KEY } from '~/services/link-account-service/link-account-service'; describe('auth-actions', () => { let reducer: (state: AuthState | undefined, action: AuthAction) => any; @@ -40,6 +41,8 @@ describe('auth-actions', () => { it('should initialise state with user and api token from local storage', () => { + // Only test the case when a link account operation is not being cancelled + sessionStorage.setItem(ACCOUNT_LINK_STATUS_KEY, "0"); localStorage.setItem(API_TOKEN_KEY, "token"); localStorage.setItem(USER_EMAIL_KEY, "test@test.com"); localStorage.setItem(USER_FIRST_NAME_KEY, "John"); @@ -64,11 +67,20 @@ describe('auth-actions', () => { sshKeys: [], homeCluster: "zzzzz", localCluster: "zzzzz", + loginCluster: undefined, + remoteHostsConfig: { + "zzzzz": { + "remoteHosts": { + "xc59z": "xc59z.arvadosapi.com", + }, + "rootUrl": "https://zzzzz.arvadosapi.com", + "uuidPrefix": "zzzzz", + }, + }, remoteHosts: { zzzzz: "zzzzz.arvadosapi.com", xc59z: "xc59z.arvadosapi.com" }, - remoteHostsConfig: {}, sessions: [{ "active": true, "baseUrl": undefined, @@ -86,7 +98,7 @@ describe('auth-actions', () => { "email": "", "loggedIn": false, "remoteHost": "xc59z.arvadosapi.com", - "status": 0, + "status": 1, "token": "", "username": "" }],