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
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;
status: 0
}
],
- currentItemId: ""
+ currentItemId: "",
+ creator: {
+ opened: false,
+ ownerUuid: "",
+ pending: false
+ }
});
});
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));