X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/dd30e03643f9b093c1fe05b05481f75906faa0e7..e4b54c3b5d99c99553e319ead28c3aa8dcd6eecc:/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 2b1920a61d..25ce2c1122 100644 --- a/src/store/auth/auth-reducer.test.ts +++ b/src/store/auth/auth-reducer.test.ts @@ -8,13 +8,18 @@ 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"; describe('auth-reducer', () => { let reducer: (state: AuthState | undefined, action: AuthAction) => any; + const actions: ApiActions = { + progressFn: (id: string, working: boolean) => {}, + errorFn: (id: string, message: string) => {} + }; beforeAll(() => { localStorage.clear(); - reducer = authReducer(createServices(mockConfig({}))); + reducer = authReducer(createServices(mockConfig({}), actions)); }); it('should correctly initialise state', () => { @@ -39,7 +44,8 @@ describe('auth-reducer', () => { const state = reducer(initialState, authActions.SAVE_API_TOKEN("token")); expect(state).toEqual({ apiToken: "token", - user: undefined + user: undefined, + sshKeys: [] }); }); @@ -57,6 +63,7 @@ describe('auth-reducer', () => { const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user)); expect(state).toEqual({ apiToken: undefined, + sshKeys: [], user: { email: "test@test.com", firstName: "John",