16212: Displays user depending on available user data.
[arvados-workbench2.git] / src / store / auth / auth-action.test.ts
index f7aa5c4c9f630abcddbbe1355cb90368f8005b0b..8a17fe9f42da87b0360845580d2ce4e8fcdabb6f 100644 (file)
@@ -8,7 +8,7 @@ import { API_TOKEN_KEY } from "~/services/auth-service/auth-service";
 import 'jest-localstorage-mock';
 import { ServiceRepository, createServices } from "~/services/services";
 import { configureStore, RootStore } from "../store";
-import createBrowserHistory from "history/createBrowserHistory";
+import { createBrowserHistory } from "history";
 import { mockConfig } from '~/common/config';
 import { ApiActions } from "~/services/api/api-actions";
 import { ACCOUNT_LINK_STATUS_KEY } from '~/services/link-account-service/link-account-service';
@@ -67,6 +67,7 @@ describe('auth-actions', () => {
             rootUrl: "https://zzzzz.arvadosapi.com",
             uuidPrefix: "zzzzz",
             remoteHosts: { xc59z: "xc59z.arvadosapi.com" },
+            apiRevision: 12345678,
         };
 
         store.dispatch(initAuth(config));
@@ -82,6 +83,7 @@ describe('auth-actions', () => {
                     expect(auth).toEqual({
                         apiToken: "token",
                         config: {
+                            apiRevision: 12345678,
                             remoteHosts: {
                                 "xc59z": "xc59z.arvadosapi.com",
                             },
@@ -94,6 +96,7 @@ describe('auth-actions', () => {
                         loginCluster: undefined,
                         remoteHostsConfig: {
                             "zzzzz": {
+                                "apiRevision": 12345678,
                                 "remoteHosts": {
                                     "xc59z": "xc59z.arvadosapi.com",
                                 },
@@ -114,8 +117,9 @@ describe('auth-actions', () => {
                             "remoteHost": "https://zzzzz.arvadosapi.com",
                             "status": 2,
                             "token": "token",
-                            "name": "John Doe"
-                   "uuid": "zzzzz-tpzed-abcefg",
+                            "name": "John Doe",
+                            "apiRevision": 12345678,
+                            "uuid": "zzzzz-tpzed-abcefg",
                         }, {
                             "active": false,
                             "baseUrl": "",
@@ -127,6 +131,7 @@ describe('auth-actions', () => {
                             "token": "",
                             "name": "",
                             "uuid": "",
+                            "apiRevision": 0,
                         }],
                         user: {
                             email: "test@test.com",