projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15803: Updating tests WIP
[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 1202bacb125b5e1afc61908cb64f9953946b41f6..e862a313d0f3dbbeddea3e71c36dbf68247ccb07 100644
(file)
--- 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 = {
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(() => {
};
beforeAll(() => {
@@
-28,23
+28,24
@@
describe('auth-reducer', () => {
email: "test@test.com",
firstName: "John",
lastName: "Doe",
email: "test@test.com",
firstName: "John",
lastName: "Doe",
- uuid: "uuid",
- ownerUuid: "ownerUuid"
+ uuid: "zzzzz-tpzed-xurymjxw79nv3jz",
+ ownerUuid: "ownerUuid",
+ username: "username",
+ prefs: {},
+ isAdmin: false,
+ isActive: true
};
const state = reducer(initialState, authActions.INIT({ user, token: "token" }));
expect(state).toEqual({
apiToken: "token",
};
const state = reducer(initialState, authActions.INIT({ user, token: "token" }));
expect(state).toEqual({
apiToken: "token",
- user
- });
- });
-
- it('should save api token', () => {
- const initialState = undefined;
-
- const state = reducer(initialState, authActions.SAVE_API_TOKEN("token"));
- expect(state).toEqual({
- apiToken: "token",
- user: undefined
+ user,
+ sshKeys: [],
+ sessions: [],
+ homeCluster: "zzzzz",
+ localCluster: "",
+ loginCluster: "",
+ remoteHosts: {},
+ remoteHostsConfig: {}
});
});
});
});
@@
-56,18
+57,33
@@
describe('auth-reducer', () => {
firstName: "John",
lastName: "Doe",
uuid: "uuid",
firstName: "John",
lastName: "Doe",
uuid: "uuid",
- ownerUuid: "ownerUuid"
+ ownerUuid: "ownerUuid",
+ username: "username",
+ prefs: {},
+ isAdmin: false,
+ isActive: true
};
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: [],
+ sessions: [],
+ homeCluster: "uuid",
+ localCluster: "",
+ loginCluster: "",
+ remoteHosts: {},
+ remoteHostsConfig: {},
user: {
email: "test@test.com",
firstName: "John",
lastName: "Doe",
uuid: "uuid",
ownerUuid: "ownerUuid",
user: {
email: "test@test.com",
firstName: "John",
lastName: "Doe",
uuid: "uuid",
ownerUuid: "ownerUuid",
+ username: "username",
+ prefs: {},
+ isAdmin: false,
+ isActive: true
}
});
});
}
});
});