refactor
[arvados.git] / src / views-components / project-tree / project-tree.test.tsx
index 1ba3abb8bb39ddb2c40de1098b769b35bd7ad105..1a5e9f9d18718237ff38c9a48dfdfb5af7906ffd 100644 (file)
@@ -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,14 +28,14 @@ describe("ProjectTree component", () => {
                 uuid: "uuid",
                 ownerUuid: "ownerUuid",
                 href: "href",
-                kind: 'example'
+                kind: ResourceKind.PROJECT
             },
             id: "3",
             open: true,
             active: true,
             status: 1
         };
-        const wrapper = mount(<ProjectTree projects={[project]} toggleOpen={jest.fn()} toggleActive={jest.fn()} />);
+        const wrapper = mount(<ProjectTree projects={[project]} onContextMenu={jest.fn()} toggleOpen={jest.fn()} toggleActive={jest.fn()} />);
 
         expect(wrapper.find(ListItemIcon)).toHaveLength(1);
     });
@@ -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,
@@ -71,7 +73,7 @@ describe("ProjectTree component", () => {
                 status: 1
             }
         ];
-        const wrapper = mount(<ProjectTree projects={project} toggleOpen={jest.fn()} toggleActive={jest.fn()} />);
+        const wrapper = mount(<ProjectTree projects={project} onContextMenu={jest.fn()} toggleOpen={jest.fn()} toggleActive={jest.fn()} />);
 
         expect(wrapper.find(ListItemIcon)).toHaveLength(2);
     });
@@ -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,
@@ -111,7 +113,7 @@ describe("ProjectTree component", () => {
                 ]
             }
         ];
-        const wrapper = mount(<ProjectTree projects={project} toggleOpen={jest.fn()} toggleActive={jest.fn()}/>);
+        const wrapper = mount(<ProjectTree projects={project} onContextMenu={jest.fn()} toggleOpen={jest.fn()} toggleActive={jest.fn()}/>);
 
         expect(wrapper.find(Collapse)).toHaveLength(1);
     });
@@ -125,14 +127,14 @@ describe("ProjectTree component", () => {
                 uuid: "uuid",
                 ownerUuid: "ownerUuid",
                 href: "href",
-                kind: 'example'
+                kind: ResourceKind.PROJECT
             },
             id: "3",
             open: false,
             active: true,
             status: 1
         };
-        const wrapper = mount(<ProjectTree projects={[project]} toggleOpen={jest.fn()} toggleActive={jest.fn()} />);
+        const wrapper = mount(<ProjectTree projects={[project]} onContextMenu={jest.fn()} toggleOpen={jest.fn()} toggleActive={jest.fn()} />);
 
         expect(wrapper.find(CircularProgress)).toHaveLength(1);
     });