[ARVADOS-WORKBENCH2] updated: 1.2.0-289-gd706856

Git user git at public.curoverse.com
Wed Sep 5 08:24:54 EDT 2018


Summary of changes:
 src/components/data-explorer/data-explorer.test.tsx |  9 ---------
 src/components/data-table/data-table.test.tsx       | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 9 deletions(-)

       via  d7068565b29b52ffe6761a81e71f0725d120211a (commit)
      from  00b22552554ddcae9cf3b68ed4017067555ba02e (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 d7068565b29b52ffe6761a81e71f0725d120211a
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Wed Sep 5 14:24:39 2018 +0200

    Update tests
    
    Feature #14160
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski 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 882c178..d74b531 100644
--- a/src/components/data-explorer/data-explorer.test.tsx
+++ b/src/components/data-explorer/data-explorer.test.tsx
@@ -73,15 +73,6 @@ describe("<DataExplorer />", () => {
         expect(onRowClick).toHaveBeenCalledWith("rowClick");
     });
 
-    it("does not render <DataTable/> if there is no items", () => {
-        const dataExplorer = mount(<DataExplorer
-            {...mockDataExplorerProps()}
-            items={[]}
-            onSetColumns={jest.fn()} />);
-        expect(dataExplorer.find(DataTable)).toHaveLength(0);
-        expect(dataExplorer.find(DefaultView)).toHaveLength(1);
-    });
-
     it("communicates with <TablePagination/>", () => {
         const onChangePage = jest.fn();
         const onChangeRowsPerPage = jest.fn();
diff --git a/src/components/data-table/data-table.test.tsx b/src/components/data-table/data-table.test.tsx
index 1201dcb..16957b4 100644
--- a/src/components/data-table/data-table.test.tsx
+++ b/src/components/data-table/data-table.test.tsx
@@ -9,6 +9,7 @@ import * as Adapter from "enzyme-adapter-react-16";
 import { DataTable, DataColumns } from "./data-table";
 import { DataTableFilters } from "../data-table-filters/data-table-filters";
 import { SortDirection, createDataColumn } from "./data-column";
+import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
 
 configure({ adapter: new Adapter() });
 
@@ -201,4 +202,24 @@ describe("<DataTable />", () => {
         dataTable.find(DataTableFilters).prop("onChange")([]);
         expect(onFiltersChange).toHaveBeenCalledWith([], columns[0]);
     });
+
+    it("shows default view if there is no items", () => {
+        const columns: DataColumns<string> = [
+            createDataColumn({
+                name: "Column 1",
+                render: () => <span />,
+                selected: true,
+                configurable: true
+            }),
+        ];
+        const dataTable = mount(<DataTable
+            columns={columns}
+            items={[]}
+            onFiltersChange={jest.fn()}
+            onRowClick={jest.fn()}
+            onRowDoubleClick={jest.fn()}
+            onContextMenu={jest.fn()}
+            onSortToggle={jest.fn()} />);
+        expect(dataTable.find(DataTableDefaultView)).toHaveLength(1);
+    });
 });

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list