X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c0411a76d1ae1e076dac049267a54366df1c8517..2ba76201944d5ad4ef84aaf16c18f5bbb38a8b89:/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 3dd486b31c..38cf1581d3 100644 --- a/src/store/auth/auth-reducer.test.ts +++ b/src/store/auth/auth-reducer.test.ts @@ -13,8 +13,8 @@ import { ApiActions } from "~/services/api/api-actions"; describe('auth-reducer', () => { let reducer: (state: AuthState | undefined, action: AuthAction) => any; const actions: ApiActions = { - progressFn: (id: string, working: boolean) => {}, - errorFn: (id: string, message: string) => {} + progressFn: (id: string, working: boolean) => { }, + errorFn: (id: string, message: string) => { } }; beforeAll(() => { @@ -28,15 +28,22 @@ describe('auth-reducer', () => { email: "test@test.com", firstName: "John", lastName: "Doe", - uuid: "uuid", + uuid: "zzzzz-tpzed-xurymjxw79nv3jz", ownerUuid: "ownerUuid", - isAdmin: true + username: "username", + prefs: {}, + isAdmin: false, + isActive: true }; const state = reducer(initialState, authActions.INIT({ user, token: "token" })); expect(state).toEqual({ apiToken: "token", user, - sshKeys: [] + sshKeys: [], + sessions: [], + homeCluster: "zzzzz", + localCluster: "", + remoteHosts: {} }); }); @@ -47,7 +54,11 @@ describe('auth-reducer', () => { expect(state).toEqual({ apiToken: "token", user: undefined, - sshKeys: [] + sshKeys: [], + sessions: [], + homeCluster: "", + localCluster: "", + remoteHosts: {}, }); }); @@ -60,20 +71,30 @@ describe('auth-reducer', () => { lastName: "Doe", uuid: "uuid", ownerUuid: "ownerUuid", - isAdmin: true + username: "username", + prefs: {}, + isAdmin: false, + isActive: true }; const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user)); expect(state).toEqual({ apiToken: undefined, sshKeys: [], + sessions: [], + homeCluster: "", + localCluster: "", + remoteHosts: {}, user: { email: "test@test.com", firstName: "John", lastName: "Doe", uuid: "uuid", ownerUuid: "ownerUuid", - isAdmin: true + username: "username", + prefs: {}, + isAdmin: false, + isActive: true } }); });