X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/56069f1f9fa111b9756e9bfa7a3b0c9dba2e9a7a..refs/heads/18881-process-runtime-status:/src/store/auth/auth-reducer.test.ts diff --git a/src/store/auth/auth-reducer.test.ts b/src/store/auth/auth-reducer.test.ts index 14d92803..6a1fb87f 100644 --- a/src/store/auth/auth-reducer.test.ts +++ b/src/store/auth/auth-reducer.test.ts @@ -6,9 +6,9 @@ import { authReducer, AuthState } from "./auth-reducer"; import { AuthAction, authActions } from "./auth-action"; import 'jest-localstorage-mock'; -import { createServices } from "~/services/services"; -import { mockConfig } from '~/common/config'; -import { ApiActions } from "~/services/api/api-actions"; +import { createServices } from "services/services"; +import { mockConfig } from 'common/config'; +import { ApiActions } from "services/api/api-actions"; describe('auth-reducer', () => { let reducer: (state: AuthState | undefined, action: AuthAction) => any; @@ -35,30 +35,16 @@ describe('auth-reducer', () => { isAdmin: false, isActive: true }; - const state = reducer(initialState, authActions.INIT({ user, token: "token" })); + const state = reducer(initialState, authActions.INIT_USER({ user, token: "token" })); expect(state).toEqual({ apiToken: "token", + config: mockConfig({}), user, sshKeys: [], sessions: [], homeCluster: "zzzzz", localCluster: "", - remoteHosts: {}, - remoteHostsConfig: {} - }); - }); - - it('should save api token', () => { - const initialState = undefined; - - const state = reducer(initialState, authActions.SAVE_API_TOKEN("token")); - expect(state).toEqual({ - apiToken: "token", - user: undefined, - sshKeys: [], - sessions: [], - homeCluster: "", - localCluster: "", + loginCluster: "", remoteHosts: {}, remoteHostsConfig: {} }); @@ -82,10 +68,12 @@ describe('auth-reducer', () => { const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user)); expect(state).toEqual({ apiToken: undefined, + config: mockConfig({}), sshKeys: [], sessions: [], - homeCluster: "", + homeCluster: "uuid", localCluster: "", + loginCluster: "", remoteHosts: {}, remoteHostsConfig: {}, user: {