Merge branch 'master' into 14524-run-a-process-white-screen
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Thu, 29 Nov 2018 16:23:26 +0000 (17:23 +0100)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Thu, 29 Nov 2018 16:23:26 +0000 (17:23 +0100)
refs #14524

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/store/auth/auth-actions.test.ts
src/store/auth/auth-reducer.test.ts

index 231c37b4effc6c2587bd4c1289c434cd7b0d1e83..c54438b170c5b1a27c945444644c6f17bfb066fb 100644 (file)
@@ -10,7 +10,8 @@ import {
     USER_FIRST_NAME_KEY,
     USER_LAST_NAME_KEY,
     USER_OWNER_UUID_KEY,
-    USER_UUID_KEY
+    USER_UUID_KEY,
+    USER_IS_ADMIN
 } from "~/services/auth-service/auth-service";
 
 import 'jest-localstorage-mock';
@@ -42,6 +43,7 @@ describe('auth-actions', () => {
         localStorage.setItem(USER_LAST_NAME_KEY, "Doe");
         localStorage.setItem(USER_UUID_KEY, "uuid");
         localStorage.setItem(USER_OWNER_UUID_KEY, "ownerUuid");
+        localStorage.setItem(USER_IS_ADMIN, JSON.stringify("false"));
 
         store.dispatch(initAuth());
 
@@ -53,7 +55,8 @@ describe('auth-actions', () => {
                 firstName: "John",
                 lastName: "Doe",
                 uuid: "uuid",
-                ownerUuid: "ownerUuid"
+                ownerUuid: "ownerUuid",
+                isAdmin: true
             }
         });
     });
index 3dd486b31cba402bd1adc92be9a8574837729b9d..a4017db3be7af4b83a69543fdc85d825516ec149 100644 (file)
@@ -30,7 +30,7 @@ describe('auth-reducer', () => {
             lastName: "Doe",
             uuid: "uuid",
             ownerUuid: "ownerUuid",
-            isAdmin: true
+            isAdmin: false
         };
         const state = reducer(initialState, authActions.INIT({ user, token: "token" }));
         expect(state).toEqual({
@@ -60,7 +60,7 @@ describe('auth-reducer', () => {
             lastName: "Doe",
             uuid: "uuid",
             ownerUuid: "ownerUuid",
-            isAdmin: true
+            isAdmin: false
         };
 
         const state = reducer(initialState, authActions.USER_DETAILS_SUCCESS(user));
@@ -73,7 +73,7 @@ describe('auth-reducer', () => {
                 lastName: "Doe",
                 uuid: "uuid",
                 ownerUuid: "ownerUuid",
-                isAdmin: true
+                isAdmin: false
             }
         });
     });