X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4ea2ff188ec745966387ce8bbe14880bfeede863..56069f1f9fa111b9756e9bfa7a3b0c9dba2e9a7a:/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 b9f768f1cb..14d92803cc 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,17 +28,23 @@ describe('auth-reducer', () => { email: "test@test.com", firstName: "John", lastName: "Doe", - uuid: "uuid", + uuid: "zzzzz-tpzed-xurymjxw79nv3jz", ownerUuid: "ownerUuid", - identityUrl: "identityUrl", + username: "username", prefs: {}, - isAdmin: false + 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: {}, + remoteHostsConfig: {} }); }); @@ -49,7 +55,12 @@ describe('auth-reducer', () => { expect(state).toEqual({ apiToken: "token", user: undefined, - sshKeys: [] + sshKeys: [], + sessions: [], + homeCluster: "", + localCluster: "", + remoteHosts: {}, + remoteHostsConfig: {} }); }); @@ -62,22 +73,31 @@ describe('auth-reducer', () => { lastName: "Doe", uuid: "uuid", ownerUuid: "ownerUuid", - identityUrl: "identityUrl", + username: "username", prefs: {}, - isAdmin: false + isAdmin: false, + isActive: true }; const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user)); expect(state).toEqual({ apiToken: undefined, sshKeys: [], + sessions: [], + homeCluster: "", + localCluster: "", + remoteHosts: {}, + remoteHostsConfig: {}, user: { email: "test@test.com", firstName: "John", lastName: "Doe", uuid: "uuid", ownerUuid: "ownerUuid", - isAdmin: false + username: "username", + prefs: {}, + isAdmin: false, + isActive: true } }); });