X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/00b22552554ddcae9cf3b68ed4017067555ba02e..d7068565b29b52ffe6761a81e71f0725d120211a:/src/components/data-table/data-table.test.tsx

diff --git a/src/components/data-table/data-table.test.tsx b/src/components/data-table/data-table.test.tsx
index 1201dcb0..16957b40 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);
+    });
 });
