Fix failing tests
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Tue, 10 Jul 2018 13:33:40 +0000 (15:33 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Tue, 10 Jul 2018 13:33:40 +0000 (15:33 +0200)
Feature #13694

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

src/components/data-explorer/data-explorer.test.tsx
src/store/project/project-reducer.test.ts

index 97b1bec602a4330fd2c4eff29ddd8dde6be59ce6..c0430827c2511103d771f14437248fa004b06c65 100644 (file)
@@ -18,21 +18,6 @@ configure({ adapter: new Adapter() });
 
 describe("<DataExplorer />", () => {
 
-    it("communicates with <ContextMenu/>", () => {
-        const onContextAction = jest.fn();
-        const dataExplorer = mount(<DataExplorer
-            {...mockDataExplorerProps()}
-            items={[{ key: "1", name: "item 1" }] as MockItem[]}
-            columns={[{ name: "Column 1", render: jest.fn(), selected: true }]} />);
-        expect(dataExplorer.find(ContextMenu).prop("actions")).toEqual([]);
-        dataExplorer.find(DataTable).prop("onRowContextMenu")({
-            preventDefault: jest.fn(),
-            stopPropagation: jest.fn()
-        }, "Item 1");
-        dataExplorer.find(ContextMenu).prop("onActionClick")({ name: "Action 1", icon: "" });
-        expect(onContextAction).toHaveBeenCalledWith({ name: "Action 1", icon: "" }, "Item 1");
-    });
-
     it("communicates with <SearchInput/>", () => {
         const onSearch = jest.fn();
         const dataExplorer = mount(<DataExplorer
index 0862142d48b264e5bd84706d5e420dff06d07d9d..f14ee9a8ef055665033286ef4593469754151198 100644 (file)
@@ -8,21 +8,6 @@ import { TreeItem, TreeItemStatus } from "../../components/tree/tree";
 import { ResourceKind } from "../../models/resource";
 
 describe('project-reducer', () => {
-    it('should add new project to the list', () => {
-        const initialState = undefined;
-        const project = {
-            name: 'test',
-            href: 'href',
-            createdAt: '2018-01-01',
-            modifiedAt: '2018-01-01',
-            ownerUuid: 'owner-test123',
-            uuid: 'test123',
-            kind: ResourceKind.PROJECT
-        };
-
-        const state = projectsReducer(initialState, actions.CREATE_PROJECT(project));
-        expect(state.items[0].data).toEqual(project);
-    });
 
     it('should load projects', () => {
         const initialState = undefined;
@@ -55,7 +40,12 @@ describe('project-reducer', () => {
                 status: 0
             }
             ],
-            currentItemId: ""
+            currentItemId: "",
+            creator: {
+                opened: false,
+                ownerUuid: "",
+                pending: false
+            }
         });
     });
 
@@ -95,7 +85,8 @@ describe('project-reducer', () => {
                 active: false,
                 status: 1
             }],
-            currentItemId: ""
+            currentItemId: "",
+            creator: { opened: false, pending: false, ownerUuid: "" },
         };
 
         const state = projectsReducer(initialState, actions.RESET_PROJECT_TREE_ACTIVITY(initialState.items[0].id));