projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement rename dialog usinf FormDialog
[arvados-workbench2.git]
/
src
/
components
/
data-explorer
/
data-explorer.test.tsx
diff --git
a/src/components/data-explorer/data-explorer.test.tsx
b/src/components/data-explorer/data-explorer.test.tsx
index 616a9c122e751cdf72746b4e58838c6d6c3d41ca..a34ab1c8edfeaf97d4f01fb3a1ee51f8b200aad2 100644
(file)
--- a/
src/components/data-explorer/data-explorer.test.tsx
+++ b/
src/components/data-explorer/data-explorer.test.tsx
@@
-11,6
+11,8
@@
import { ColumnSelector } from "../column-selector/column-selector";
import { DataTable } from "../data-table/data-table";
import { SearchInput } from "../search-input/search-input";
import { TablePagination } from "@material-ui/core";
import { DataTable } from "../data-table/data-table";
import { SearchInput } from "../search-input/search-input";
import { TablePagination } from "@material-ui/core";
+import { ProjectIcon } from '../icon/icon';
+import { DefaultView } from '../default-view/default-view';
configure({ adapter: new Adapter() });
configure({ adapter: new Adapter() });
@@
-30,7
+32,7
@@
describe("<DataExplorer />", () => {
it("communicates with <ColumnSelector/>", () => {
const onColumnToggle = jest.fn();
it("communicates with <ColumnSelector/>", () => {
const onColumnToggle = jest.fn();
- const columns = [{ name: "Column 1", render: jest.fn(), selected: true }];
+ const columns = [{ name: "Column 1", render: jest.fn(), selected: true
, configurable: true
}];
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
columns={columns}
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
columns={columns}
@@
-45,7
+47,7
@@
describe("<DataExplorer />", () => {
const onFiltersChange = jest.fn();
const onSortToggle = jest.fn();
const onRowClick = jest.fn();
const onFiltersChange = jest.fn();
const onSortToggle = jest.fn();
const onRowClick = jest.fn();
- const columns = [{ name: "Column 1", render: jest.fn(), selected: true }];
+ const columns = [{ name: "Column 1", render: jest.fn(), selected: true
, configurable: true
}];
const items = [{ name: "item 1" }];
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
const items = [{ name: "item 1" }];
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
@@
-64,12
+66,13
@@
describe("<DataExplorer />", () => {
expect(onRowClick).toHaveBeenCalledWith("rowClick");
});
expect(onRowClick).toHaveBeenCalledWith("rowClick");
});
- it("does not render <
TablePagination
/> if there is no items", () => {
+ it("does not render <
DataTable
/> if there is no items", () => {
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
items={[]}
/>);
const dataExplorer = mount(<DataExplorer
{...mockDataExplorerProps()}
items={[]}
/>);
- expect(dataExplorer.find(TablePagination)).toHaveLength(0);
+ expect(dataExplorer.find(DataTable)).toHaveLength(0);
+ expect(dataExplorer.find(DefaultView)).toHaveLength(1);
});
it("communicates with <TablePagination/>", () => {
});
it("communicates with <TablePagination/>", () => {
@@
-100,6
+103,7
@@
const mockDataExplorerProps = () => ({
searchValue: "",
page: 0,
rowsPerPage: 0,
searchValue: "",
page: 0,
rowsPerPage: 0,
+ rowsPerPageOptions: [0],
onSearch: jest.fn(),
onFiltersChange: jest.fn(),
onSortToggle: jest.fn(),
onSearch: jest.fn(),
onFiltersChange: jest.fn(),
onSortToggle: jest.fn(),
@@
-108,5
+112,7
@@
const mockDataExplorerProps = () => ({
onColumnToggle: jest.fn(),
onChangePage: jest.fn(),
onChangeRowsPerPage: jest.fn(),
onColumnToggle: jest.fn(),
onChangePage: jest.fn(),
onChangeRowsPerPage: jest.fn(),
- onContextMenu: jest.fn()
+ onContextMenu: jest.fn(),
+ defaultIcon: ProjectIcon,
+ defaultMessages: ['testing'],
});
});