X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/ec2ce1a965e15cb272737251b56bca2c1529ebff..02fe86a56f080ed1d5770ad6c6856a15f50ab508:/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 11f29e45..1ebc8db9 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,6 +67,7 @@ describe('auth-actions', () => { sshKeys: [], homeCluster: "zzzzz", localCluster: "zzzzz", + remoteHostsConfig: {}, remoteHosts: { zzzzz: "zzzzz.arvadosapi.com", xc59z: "xc59z.arvadosapi.com"