email: "test@test.com",
firstName: "John",
lastName: "Doe",
- uuid: "uuid",
+ uuid: "zzzzz-tpzed-xurymjxw79nv3jz",
ownerUuid: "ownerUuid",
username: "username",
prefs: {},
- isAdmin: false
+ isAdmin: false,
+ isActive: true
};
- const state = reducer(initialState, authActions.INIT({ user, token: "token" }));
+ const state = reducer(initialState, authActions.INIT_USER({ user, token: "token" }));
expect(state).toEqual({
apiToken: "token",
+ config: mockConfig({}),
user,
sshKeys: [],
- sessions: []
- });
- });
-
- it('should save api token', () => {
- const initialState = undefined;
-
- const state = reducer(initialState, authActions.SAVE_API_TOKEN("token"));
- expect(state).toEqual({
- apiToken: "token",
- user: undefined,
- sshKeys: [],
- sessions: []
+ sessions: [],
+ homeCluster: "zzzzz",
+ localCluster: "",
+ loginCluster: "",
+ remoteHosts: {},
+ remoteHostsConfig: {}
});
});
ownerUuid: "ownerUuid",
username: "username",
prefs: {},
- isAdmin: false
+ isAdmin: false,
+ isActive: true
};
const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user));
expect(state).toEqual({
apiToken: undefined,
+ config: mockConfig({}),
sshKeys: [],
sessions: [],
+ homeCluster: "uuid",
+ localCluster: "",
+ loginCluster: "",
+ remoteHosts: {},
+ remoteHostsConfig: {},
user: {
email: "test@test.com",
firstName: "John",
ownerUuid: "ownerUuid",
username: "username",
prefs: {},
- isAdmin: false
+ isAdmin: false,
+ isActive: true
}
});
});