- expect(store.getState().auth).toEqual({
- apiToken: "token",
- sshKeys: [],
- homeCluster: "zzzzz",
- localCluster: "zzzzz",
- loginCluster: undefined,
- remoteHostsConfig: {
- "zzzzz": {
- "remoteHosts": {
- "xc59z": "xc59z.arvadosapi.com",
- },
- "rootUrl": "https://zzzzz.arvadosapi.com",
- "uuidPrefix": "zzzzz",
- },
- },
- remoteHosts: {
- zzzzz: "zzzzz.arvadosapi.com",
- xc59z: "xc59z.arvadosapi.com"
- },
- sessions: [{
- "active": true,
- "baseUrl": undefined,
- "clusterId": "zzzzz",
- "email": "test@test.com",
- "loggedIn": true,
- "remoteHost": "https://zzzzz.arvadosapi.com",
- "status": 2,
- "token": "token",
- "name": "John Doe"
- "uuid": "zzzzz-tpzed-abcefg",
- }, {
- "active": false,
- "baseUrl": "",
- "clusterId": "xc59z",
- "email": "",
- "loggedIn": false,
- "remoteHost": "xc59z.arvadosapi.com",
- "status": 1,
- "token": "",
- "name": "",
- "uuid": "",
- }],
- user: {
- email: "test@test.com",
- firstName: "John",
- lastName: "Doe",
- uuid: "zzzzz-tpzed-abcefg",
- ownerUuid: "ownerUuid",
- username: "jdoe",
- prefs: {},
- isAdmin: false,
- isActive: true
+ store.subscribe(() => {
+ const auth = store.getState().auth;
+ if (auth.apiToken === "token" &&
+ auth.sessions.length === 2 &&
+ auth.sessions[0].status === 2 &&
+ auth.sessions[1].status === 2
+ ) {
+ try {
+ expect(auth).toEqual({
+ apiToken: "token",
+ sshKeys: [],
+ homeCluster: "zzzzz",
+ localCluster: "zzzzz",
+ loginCluster: undefined,
+ remoteHostsConfig: {
+ "zzzzz": {
+ "remoteHosts": {
+ "xc59z": "xc59z.arvadosapi.com",
+ },
+ "rootUrl": "https://zzzzz.arvadosapi.com",
+ "uuidPrefix": "zzzzz",
+ },
+ },
+ remoteHosts: {
+ zzzzz: "zzzzz.arvadosapi.com",
+ xc59z: "xc59z.arvadosapi.com"
+ },
+ sessions: [{
+ "active": true,
+ "baseUrl": undefined,
+ "clusterId": "zzzzz",
+ "email": "test@test.com",
+ "loggedIn": true,
+ "remoteHost": "https://zzzzz.arvadosapi.com",
+ "status": 2,
+ "token": "token",
+ "name": "John Doe"
+ "uuid": "zzzzz-tpzed-abcefg",
+ }, {
+ "active": false,
+ "baseUrl": "",
+ "clusterId": "xc59z",
+ "email": "",
+ "loggedIn": false,
+ "remoteHost": "xc59z.arvadosapi.com",
+ "status": 2,
+ "token": "",
+ "name": "",
+ "uuid": "",
+ }],
+ user: {
+ email: "test@test.com",
+ firstName: "John",
+ lastName: "Doe",
+ uuid: "zzzzz-tpzed-abcefg",
+ ownerUuid: "ownerUuid",
+ username: "jdoe",
+ prefs: { profile: {} },
+ isAdmin: false,
+ isActive: true
+ }
+ });
+ done();
+ } catch (e) {
+ console.log(e);
+ }