Move Resource interface to models, unify ResourceKind enum
[arvados.git] / src / components / data-explorer / data-explorer.test.tsx
index 33899c00c79aa242c902c7c4d6af7cc11c741900..c0430827c2511103d771f14437248fa004b06c65 100644 (file)
@@ -18,23 +18,6 @@ configure({ adapter: new Adapter() });
 
 describe("<DataExplorer />", () => {
 
-    it("communicates with <ContextMenu/>", () => {
-        const onContextAction = jest.fn();
-        const dataExplorer = mount(<DataExplorer
-            {...mockDataExplorerProps()}
-            contextActions={[]}
-            onContextAction={onContextAction}
-            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
@@ -54,7 +37,6 @@ describe("<DataExplorer />", () => {
             {...mockDataExplorerProps()}
             columns={columns}
             onColumnToggle={onColumnToggle}
-            contextActions={[]}
             items={[{ key: "1", name: "item 1" }] as MockItem[]} />);
         expect(dataExplorer.find(ColumnSelector).prop("columns")).toBe(columns);
         dataExplorer.find(ColumnSelector).prop("onColumnToggle")("columns");
@@ -125,7 +107,7 @@ const mockDataExplorerProps = () => ({
     onSortToggle: jest.fn(),
     onRowClick: jest.fn(),
     onColumnToggle: jest.fn(),
-    onContextAction: jest.fn(),
     onChangePage: jest.fn(),
-    onChangeRowsPerPage: jest.fn()
+    onChangeRowsPerPage: jest.fn(),
+    onContextMenu: jest.fn()
 });
\ No newline at end of file