X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c4882a6046934f1beea8dc1cc741e690cec357af..d4f479b1c2bd4bb67d5e69f792b503f375d6dfc9:/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..f527edec21 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(() => { @@ -30,13 +30,16 @@ describe('auth-reducer', () => { lastName: "Doe", uuid: "uuid", ownerUuid: "ownerUuid", - isAdmin: true + username: "username", + prefs: {}, + isAdmin: false }; const state = reducer(initialState, authActions.INIT({ user, token: "token" })); expect(state).toEqual({ apiToken: "token", user, - sshKeys: [] + sshKeys: [], + sessions: [] }); }); @@ -47,7 +50,8 @@ describe('auth-reducer', () => { expect(state).toEqual({ apiToken: "token", user: undefined, - sshKeys: [] + sshKeys: [], + sessions: [] }); }); @@ -60,20 +64,25 @@ describe('auth-reducer', () => { lastName: "Doe", uuid: "uuid", ownerUuid: "ownerUuid", - isAdmin: true + username: "username", + prefs: {}, + isAdmin: false }; const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user)); expect(state).toEqual({ apiToken: undefined, sshKeys: [], + sessions: [], user: { email: "test@test.com", firstName: "John", lastName: "Doe", uuid: "uuid", ownerUuid: "ownerUuid", - isAdmin: true + username: "username", + prefs: {}, + isAdmin: false } }); });