projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed conflicts
[arvados.git]
/
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 bc9d34ee0ae5dde439e3332837867037669a96ba..25ce2c1122d7b9688eb71193ddb1be1ce3ec5649 100644
(file)
--- a/
src/store/auth/auth-reducer.test.ts
+++ b/
src/store/auth/auth-reducer.test.ts
@@
-7,13
+7,19
@@
import { AuthAction, authActions } from "./auth-action";
import 'jest-localstorage-mock';
import { createServices } from "~/services/services";
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;
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();
beforeAll(() => {
localStorage.clear();
- reducer = authReducer(createServices(
"/arvados/v1"
));
+ reducer = authReducer(createServices(
mockConfig({}), actions
));
});
it('should correctly initialise state', () => {
});
it('should correctly initialise state', () => {
@@
-25,7
+31,7
@@
describe('auth-reducer', () => {
uuid: "uuid",
ownerUuid: "ownerUuid"
};
uuid: "uuid",
ownerUuid: "ownerUuid"
};
- const state = reducer(initialState, authActions.INIT({
user, token: "token"
}));
+ const state = reducer(initialState, authActions.INIT({
user, token: "token"
}));
expect(state).toEqual({
apiToken: "token",
user
expect(state).toEqual({
apiToken: "token",
user
@@
-38,7
+44,8
@@
describe('auth-reducer', () => {
const state = reducer(initialState, authActions.SAVE_API_TOKEN("token"));
expect(state).toEqual({
apiToken: "token",
const state = reducer(initialState, authActions.SAVE_API_TOKEN("token"));
expect(state).toEqual({
apiToken: "token",
- user: undefined
+ user: undefined,
+ sshKeys: []
});
});
});
});
@@
-56,6
+63,7
@@
describe('auth-reducer', () => {
const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user));
expect(state).toEqual({
apiToken: undefined,
const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user));
expect(state).toEqual({
apiToken: undefined,
+ sshKeys: [],
user: {
email: "test@test.com",
firstName: "John",
user: {
email: "test@test.com",
firstName: "John",