[ARVADOS-WORKBENCH2] updated: 1.1.4-150-gafa829a

Git user git at public.curoverse.com
Tue Jun 26 07:28:23 EDT 2018


Summary of changes:
 src/store/project/project-reducer.test.ts          | 45 ++++++++++++----------
 .../project-tree/project-tree.test.tsx             | 16 ++++----
 src/views/workbench/workbench.test.tsx             | 11 +++++-
 3 files changed, 43 insertions(+), 29 deletions(-)

       via  afa829ac853b470517757951c51c6a8b1316f0f1 (commit)
      from  278f75bd896ee35887282f61e10bbeaf6471011d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit afa829ac853b470517757951c51c6a8b1316f0f1
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Tue Jun 26 13:27:47 2018 +0200

    Fixed test passing
    
    No issue #
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/store/project/project-reducer.test.ts b/src/store/project/project-reducer.test.ts
index 65a856b..f430104 100644
--- a/src/store/project/project-reducer.test.ts
+++ b/src/store/project/project-reducer.test.ts
@@ -21,7 +21,7 @@ describe('project-reducer', () => {
         };
 
         const state = projectsReducer(initialState, actions.CREATE_PROJECT(project));
-        expect(state).toEqual([project]);
+        expect(state.items[0].data).toEqual(project);
     });
 
     it('should load projects', () => {
@@ -38,22 +38,25 @@ describe('project-reducer', () => {
 
         const projects = [project, project];
         const state = projectsReducer(initialState, actions.PROJECTS_SUCCESS({ projects, parentItemId: undefined }));
-        expect(state).toEqual([{
-            active: false,
-            open: false,
-            id: "test123",
-            items: [],
-            data: project,
-            status: 0
-        }, {
-            active: false,
-            open: false,
-            id: "test123",
-            items: [],
-            data: project,
-            status: 0
-        }
-        ]);
+        expect(state).toEqual({
+            items: [{
+                active: false,
+                open: false,
+                id: "test123",
+                items: [],
+                data: project,
+                status: 0
+            }, {
+                active: false,
+                open: false,
+                id: "test123",
+                items: [],
+                data: project,
+                status: 0
+            }
+            ],
+            currentItemId: ""
+        });
     });
 
     it('should remove activity on projects list', () => {
@@ -91,10 +94,10 @@ describe('project-reducer', () => {
                 active: false,
                 status: 1
             }],
-            currentItemId: "1"
+            currentItemId: ""
         };
 
-        const state = projectsReducer(initialState, actions.RESET_PROJECT_TREE_ACTIVITY(initialState[0].id));
+        const state = projectsReducer(initialState, actions.RESET_PROJECT_TREE_ACTIVITY(initialState.items[0].id));
         expect(state).toEqual(project);
     });
 
@@ -136,7 +139,7 @@ describe('project-reducer', () => {
             currentItemId: "1"
         };
 
-        const state = projectsReducer(initialState, actions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(initialState[0].id));
+        const state = projectsReducer(initialState, actions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(initialState.items[0].id));
         expect(state).toEqual(project);
     });
 
@@ -181,7 +184,7 @@ describe('project-reducer', () => {
             currentItemId: "1"
         };
 
-        const state = projectsReducer(initialState, actions.TOGGLE_PROJECT_TREE_ITEM_OPEN(initialState[0].id));
+        const state = projectsReducer(initialState, actions.TOGGLE_PROJECT_TREE_ITEM_OPEN(initialState.items[0].id));
         expect(state).toEqual(project);
     });
 });
diff --git a/src/views-components/project-tree/project-tree.test.tsx b/src/views-components/project-tree/project-tree.test.tsx
index 1ba3abb..7725da5 100644
--- a/src/views-components/project-tree/project-tree.test.tsx
+++ b/src/views-components/project-tree/project-tree.test.tsx
@@ -3,8 +3,8 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { mount } from 'enzyme';
 import * as Enzyme from 'enzyme';
+import { mount } from 'enzyme';
 import * as Adapter from 'enzyme-adapter-react-16';
 import ListItemIcon from '@material-ui/core/ListItemIcon';
 import { Collapse } from '@material-ui/core';
@@ -13,6 +13,8 @@ import CircularProgress from '@material-ui/core/CircularProgress';
 import ProjectTree from './project-tree';
 import { TreeItem } from '../../components/tree/tree';
 import { Project } from '../../models/project';
+import { ResourceKind } from "../../models/resource";
+
 Enzyme.configure({ adapter: new Adapter() });
 
 describe("ProjectTree component", () => {
@@ -26,7 +28,7 @@ describe("ProjectTree component", () => {
                 uuid: "uuid",
                 ownerUuid: "ownerUuid",
                 href: "href",
-                kind: 'example'
+                kind: ResourceKind.PROJECT
             },
             id: "3",
             open: true,
@@ -48,7 +50,7 @@ describe("ProjectTree component", () => {
                     uuid: "uuid",
                     ownerUuid: "ownerUuid",
                     href: "href",
-                    kind: 'example'
+                    kind: ResourceKind.PROJECT
                 },
                 id: "3",
                 open: false,
@@ -63,7 +65,7 @@ describe("ProjectTree component", () => {
                     uuid: "uuid",
                     ownerUuid: "ownerUuid",
                     href: "href",
-                    kind: 'example'
+                    kind: ResourceKind.PROJECT
                 },
                 id: "3",
                 open: false,
@@ -86,7 +88,7 @@ describe("ProjectTree component", () => {
                     uuid: "uuid",
                     ownerUuid: "ownerUuid",
                     href: "href",
-                    kind: 'example'
+                    kind: ResourceKind.PROJECT
                 },
                 id: "3",
                 open: true,
@@ -101,7 +103,7 @@ describe("ProjectTree component", () => {
                             uuid: "uuid",
                             ownerUuid: "ownerUuid",
                             href: "href",
-                            kind: 'example'
+                            kind: ResourceKind.PROJECT
                         },
                         id: "3",
                         open: true,
@@ -125,7 +127,7 @@ describe("ProjectTree component", () => {
                 uuid: "uuid",
                 ownerUuid: "ownerUuid",
                 href: "href",
-                kind: 'example'
+                kind: ResourceKind.PROJECT
             },
             id: "3",
             open: false,
diff --git a/src/views/workbench/workbench.test.tsx b/src/views/workbench/workbench.test.tsx
index 6925792..6edebaf 100644
--- a/src/views/workbench/workbench.test.tsx
+++ b/src/views/workbench/workbench.test.tsx
@@ -14,7 +14,16 @@ const history = createBrowserHistory();
 
 it('renders without crashing', () => {
     const div = document.createElement('div');
-    const store = configureStore({ projects: [], router: { location: null }, auth: {}, sidePanel: [] }, createBrowserHistory());
+    const store = configureStore({
+        projects: {
+            items: [],
+            currentItemId: ""
+        },
+        collections: [],
+        router: { location: null },
+        auth: {},
+        sidePanel: []
+    }, createBrowserHistory());
     ReactDOM.render(
         <Provider store={store}>
             <ConnectedRouter history={history}>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list