[ARVADOS-WORKBENCH2] updated: 1.1.4-576-g0eea74d
Git user
git at public.curoverse.com
Fri Aug 10 03:18:37 EDT 2018
Summary of changes:
src/components/data-explorer/data-explorer.test.tsx | 16 +++++++++++-----
src/components/data-explorer/data-explorer.tsx | 2 +-
2 files changed, 12 insertions(+), 6 deletions(-)
via 0eea74dd422f762226b5b854274a8c18b9c24a1b (commit)
from c3cbb4ad3272bbd8f8b282a3db00a86c674e4117 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 0eea74dd422f762226b5b854274a8c18b9c24a1b
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date: Fri Aug 10 09:18:23 2018 +0200
fix test for data-explorer
Feature #13894
Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>
diff --git a/src/components/data-explorer/data-explorer.test.tsx b/src/components/data-explorer/data-explorer.test.tsx
index 616a9c1..a34ab1c 100644
--- 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 { ProjectIcon } from '../icon/icon';
+import { DefaultView } from '../default-view/default-view';
configure({ adapter: new Adapter() });
@@ -30,7 +32,7 @@ describe("<DataExplorer />", () => {
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}
@@ -45,7 +47,7 @@ describe("<DataExplorer />", () => {
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()}
@@ -64,12 +66,13 @@ describe("<DataExplorer />", () => {
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={[]}
/>);
- expect(dataExplorer.find(TablePagination)).toHaveLength(0);
+ expect(dataExplorer.find(DataTable)).toHaveLength(0);
+ expect(dataExplorer.find(DefaultView)).toHaveLength(1);
});
it("communicates with <TablePagination/>", () => {
@@ -100,6 +103,7 @@ const mockDataExplorerProps = () => ({
searchValue: "",
page: 0,
rowsPerPage: 0,
+ rowsPerPageOptions: [0],
onSearch: jest.fn(),
onFiltersChange: jest.fn(),
onSortToggle: jest.fn(),
@@ -108,5 +112,7 @@ const mockDataExplorerProps = () => ({
onColumnToggle: jest.fn(),
onChangePage: jest.fn(),
onChangeRowsPerPage: jest.fn(),
- onContextMenu: jest.fn()
+ onContextMenu: jest.fn(),
+ defaultIcon: ProjectIcon,
+ defaultMessages: ['testing'],
});
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index 028cc39..7acc1a8 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -12,7 +12,7 @@ import { DataTableFilterItem } from '../data-table-filters/data-table-filters';
import { SearchInput } from '../search-input/search-input';
import { ArvadosTheme } from "../../common/custom-theme";
import { DefaultView } from '../default-view/default-view';
-import { ProjectIcon, IconType } from '../icon/icon';
+import { IconType } from '../icon/icon';
type CssRules = 'searchBox' | "toolbar" | 'defaultRoot' | 'defaultMessage' | 'defaultIcon';
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list