import CircularProgress from '@material-ui/core/CircularProgress';
import { ProjectTree } from './project-tree';
-import { TreeItem } from '../../components/tree/tree';
+import { TreeItem, TreeItemStatus } from '../../components/tree/tree';
import { ProjectResource } from '../../models/project';
import { mockProjectResource } from '../../models/test-utils';
id: "3",
open: true,
active: true,
- status: 1
+ status: TreeItemStatus.PENDING
};
const wrapper = mount(<ProjectTree
projects={[project]}
toggleActive={jest.fn()}
onContextMenu={jest.fn()} />);
- expect(wrapper.find(ListItemIcon)).toHaveLength(1);
- });
-
- it("should render 2 ListItemIcons", () => {
- const project: Array<TreeItem<ProjectResource>> = [
- {
- data: mockProjectResource(),
- id: "3",
- open: false,
- active: true,
- status: 1
- },
- {
- data: mockProjectResource(),
- id: "3",
- open: false,
- active: true,
- status: 1
- }
- ];
- const wrapper = mount(<ProjectTree
- projects={project}
- toggleOpen={jest.fn()}
- toggleActive={jest.fn()}
- onContextMenu={jest.fn()} />);
-
expect(wrapper.find(ListItemIcon)).toHaveLength(2);
});
id: "3",
open: true,
active: true,
- status: 2,
+ status: TreeItemStatus.LOADED,
items: [
{
data: mockProjectResource(),
id: "3",
open: true,
active: true,
- status: 1
+ status: TreeItemStatus.PENDING
}
]
}
id: "3",
open: false,
active: true,
- status: 1
+ status: TreeItemStatus.PENDING
};
const wrapper = mount(<ProjectTree
projects={[project]}