@urbanos/react-discovery-ui 2.1.43 → 2.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/components/collapsable-box/collapsable-box.js +8 -1
- package/lib/components/data-view/data-view.js +211 -165
- package/lib/components/data-view/data-view.scss +9 -1
- package/lib/components/data-view/data-view.test.js +24 -30
- package/lib/components/dataset-dictionary/dataset-dictionary.js +132 -76
- package/lib/components/dataset-dictionary/dataset-dictionary.scss +4 -2
- package/lib/components/dataset-dictionary/dataset-dictionary.test.js +18 -27
- package/lib/components/dataset-metadata/dataset-metadata.js +180 -146
- package/lib/components/dataset-metadata/dataset-metadata.test.js +23 -12
- package/lib/components/dataset-preview/dataset-preview.js +0 -1
- package/lib/pages/query-view/query-view.test.js +0 -1
- package/lib/pages/user-profile-view/user-profile-view.js +106 -27
- package/lib/pages/user-profile-view/user-profile-view.test.js +4 -7
- package/package.json +2 -2
|
@@ -1,100 +1,156 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
require("./dataset-dictionary.scss");
|
|
9
|
-
var _reactTable =
|
|
10
|
-
require("react-table/react-table.css");
|
|
10
|
+
var _reactTable = require("@tanstack/react-table");
|
|
11
11
|
var _collapsableBox = _interopRequireDefault(require("../../components/collapsable-box"));
|
|
12
12
|
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
21
|
var expanderWidth = 35;
|
|
15
22
|
var expandedArrow = "\u25BE";
|
|
16
23
|
var collapsedArrow = "\u25B8";
|
|
17
|
-
var renderFieldNameCell = function renderFieldNameCell(schemaElement) {
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
19
|
-
text: schemaElement.value
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var renderTypeCell = function renderTypeCell(schemaElement) {
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement("div", null, schemaElement.value === 'list' ? "list of ".concat(schemaElement.original.itemType) : schemaElement.value);
|
|
24
|
-
};
|
|
25
24
|
var isMap = function isMap(schemaElement) {
|
|
26
25
|
return schemaElement.type === 'map' || schemaElement.itemType === 'map';
|
|
27
26
|
};
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
var schemaColumns = [{
|
|
28
|
+
id: 'expander',
|
|
29
|
+
header: function header() {
|
|
30
|
+
return null;
|
|
31
|
+
},
|
|
32
|
+
size: expanderWidth,
|
|
33
|
+
enableSorting: false,
|
|
34
|
+
cell: function cell(_ref) {
|
|
35
|
+
var row = _ref.row;
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
+
className: "expander",
|
|
38
|
+
style: {
|
|
39
|
+
cursor: isMap(row.original) ? 'pointer' : undefined
|
|
40
|
+
}
|
|
41
|
+
}, isMap(row.original) ? row.getIsExpanded() ? expandedArrow : collapsedArrow : '');
|
|
34
42
|
}
|
|
35
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
-
className: "expander"
|
|
37
|
-
}, content);
|
|
38
|
-
};
|
|
39
|
-
var renderSubTable = function renderSubTable(_ref2) {
|
|
40
|
-
var schemaElement = _ref2.original;
|
|
41
|
-
return isMap(schemaElement) ? /*#__PURE__*/_react.default.createElement(SchemaTable, {
|
|
42
|
-
schema: schemaElement.subSchema,
|
|
43
|
-
parentFieldName: schemaElement.name,
|
|
44
|
-
style: {
|
|
45
|
-
marginLeft: "".concat(expanderWidth, "px")
|
|
46
|
-
}
|
|
47
|
-
}) : /*#__PURE__*/_react.default.createElement("span", null);
|
|
48
|
-
};
|
|
49
|
-
var columns = [{
|
|
50
|
-
Header: 'Field',
|
|
51
|
-
accessor: 'name',
|
|
52
|
-
headerClassName: 'table-header',
|
|
53
|
-
width: 240,
|
|
54
|
-
className: 'field-name-cell',
|
|
55
|
-
Cell: renderFieldNameCell
|
|
56
43
|
}, {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
header: 'Field',
|
|
45
|
+
accessorKey: 'name',
|
|
46
|
+
meta: {
|
|
47
|
+
headerClassName: 'table-header',
|
|
48
|
+
className: 'field-name-cell'
|
|
49
|
+
},
|
|
50
|
+
size: 240,
|
|
51
|
+
cell: function cell(_ref2) {
|
|
52
|
+
var getValue = _ref2.getValue;
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
54
|
+
text: getValue()
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
header: 'Type',
|
|
59
|
+
accessorKey: 'type',
|
|
60
|
+
meta: {
|
|
61
|
+
headerClassName: 'table-header'
|
|
62
|
+
},
|
|
63
|
+
size: 120,
|
|
64
|
+
cell: function cell(_ref3) {
|
|
65
|
+
var getValue = _ref3.getValue,
|
|
66
|
+
row = _ref3.row;
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement("div", null, getValue() === 'list' ? "list of ".concat(row.original.itemType) : getValue());
|
|
68
|
+
}
|
|
62
69
|
}, {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
header: 'Description',
|
|
71
|
+
accessorKey: 'description',
|
|
72
|
+
meta: {
|
|
73
|
+
headerClassName: 'table-header',
|
|
74
|
+
className: 'description-cell'
|
|
75
|
+
}
|
|
67
76
|
}];
|
|
68
77
|
var isEmpty = function isEmpty(schema) {
|
|
69
78
|
return !schema || schema.length < 1;
|
|
70
79
|
};
|
|
71
|
-
var
|
|
72
|
-
var schema =
|
|
73
|
-
|
|
74
|
-
parentFieldName =
|
|
75
|
-
style =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
80
|
+
var _SchemaTable = function SchemaTable(_ref4) {
|
|
81
|
+
var schema = _ref4.schema,
|
|
82
|
+
_ref4$parentFieldName = _ref4.parentFieldName,
|
|
83
|
+
parentFieldName = _ref4$parentFieldName === void 0 ? '' : _ref4$parentFieldName,
|
|
84
|
+
style = _ref4.style;
|
|
85
|
+
var _useState = (0, _react.useState)([]),
|
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
87
|
+
sorting = _useState2[0],
|
|
88
|
+
setSorting = _useState2[1];
|
|
89
|
+
var _useState3 = (0, _react.useState)({}),
|
|
90
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
91
|
+
expanded = _useState4[0],
|
|
92
|
+
setExpanded = _useState4[1];
|
|
93
|
+
var table = (0, _reactTable.useReactTable)({
|
|
94
|
+
data: schema,
|
|
95
|
+
columns: schemaColumns,
|
|
96
|
+
state: {
|
|
97
|
+
sorting: sorting,
|
|
98
|
+
expanded: expanded
|
|
99
|
+
},
|
|
100
|
+
onSortingChange: setSorting,
|
|
101
|
+
onExpandedChange: setExpanded,
|
|
102
|
+
getRowCanExpand: function getRowCanExpand(row) {
|
|
103
|
+
return isMap(row.original);
|
|
104
|
+
},
|
|
105
|
+
getCoreRowModel: (0, _reactTable.getCoreRowModel)(),
|
|
106
|
+
getSortedRowModel: (0, _reactTable.getSortedRowModel)(),
|
|
107
|
+
getExpandedRowModel: (0, _reactTable.getExpandedRowModel)()
|
|
108
|
+
});
|
|
109
|
+
if (!schema) {
|
|
94
110
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
95
111
|
className: "error"
|
|
96
112
|
}, "Schema information not found. Contact the data curator.");
|
|
97
113
|
}
|
|
114
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
115
|
+
className: "dataset-schema-table ".concat(parentFieldName),
|
|
116
|
+
style: style
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement("table", null, /*#__PURE__*/_react.default.createElement("thead", null, table.getHeaderGroups().map(function (headerGroup) {
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
119
|
+
key: headerGroup.id
|
|
120
|
+
}, headerGroup.headers.map(function (header) {
|
|
121
|
+
var _header$column$column;
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement("th", {
|
|
123
|
+
key: header.id,
|
|
124
|
+
scope: "col",
|
|
125
|
+
className: ((_header$column$column = header.column.columnDef.meta) === null || _header$column$column === void 0 ? void 0 : _header$column$column.headerClassName) || '',
|
|
126
|
+
style: {
|
|
127
|
+
width: header.column.getSize() !== 150 ? "".concat(header.column.getSize(), "px") : undefined,
|
|
128
|
+
cursor: header.column.getCanSort() ? 'pointer' : undefined
|
|
129
|
+
},
|
|
130
|
+
onClick: header.column.getCanSort() ? header.column.getToggleSortingHandler() : undefined,
|
|
131
|
+
"aria-sort": header.column.getIsSorted() === 'asc' ? 'ascending' : header.column.getIsSorted() === 'desc' ? 'descending' : undefined
|
|
132
|
+
}, header.isPlaceholder ? null : (0, _reactTable.flexRender)(header.column.columnDef.header, header.getContext()), header.column.getIsSorted() === 'asc' ? ' ↑' : header.column.getIsSorted() === 'desc' ? ' ↓' : '');
|
|
133
|
+
}));
|
|
134
|
+
})), /*#__PURE__*/_react.default.createElement("tbody", null, table.getRowModel().rows.map(function (row) {
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
136
|
+
key: row.id
|
|
137
|
+
}, /*#__PURE__*/_react.default.createElement("tr", null, row.getVisibleCells().map(function (cell) {
|
|
138
|
+
var _cell$column$columnDe;
|
|
139
|
+
return /*#__PURE__*/_react.default.createElement("td", {
|
|
140
|
+
key: cell.id,
|
|
141
|
+
className: "".concat(cell.column.id === 'expander' ? 'expander-td' : '', " ").concat(((_cell$column$columnDe = cell.column.columnDef.meta) === null || _cell$column$columnDe === void 0 ? void 0 : _cell$column$columnDe.className) || ''),
|
|
142
|
+
onClick: cell.column.id === 'expander' && isMap(row.original) ? row.getToggleExpandedHandler() : undefined
|
|
143
|
+
}, (0, _reactTable.flexRender)(cell.column.columnDef.cell, cell.getContext()));
|
|
144
|
+
})), row.getIsExpanded() && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
145
|
+
colSpan: schemaColumns.length
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement(_SchemaTable, {
|
|
147
|
+
schema: row.original.subSchema,
|
|
148
|
+
parentFieldName: row.original.name,
|
|
149
|
+
style: {
|
|
150
|
+
marginLeft: "".concat(expanderWidth, "px")
|
|
151
|
+
}
|
|
152
|
+
}))));
|
|
153
|
+
}))));
|
|
98
154
|
};
|
|
99
155
|
var viewLink = function viewLink(datasetId) {
|
|
100
156
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -107,11 +163,11 @@ var viewLink = function viewLink(datasetId) {
|
|
|
107
163
|
className: "view-text"
|
|
108
164
|
}, "View as JSON")));
|
|
109
165
|
};
|
|
110
|
-
var _default = exports.default = function _default(
|
|
111
|
-
var schema =
|
|
112
|
-
datasetId =
|
|
113
|
-
|
|
114
|
-
expanded =
|
|
166
|
+
var _default = exports.default = function _default(_ref5) {
|
|
167
|
+
var schema = _ref5.schema,
|
|
168
|
+
datasetId = _ref5.datasetId,
|
|
169
|
+
_ref5$expanded = _ref5.expanded,
|
|
170
|
+
expanded = _ref5$expanded === void 0 ? true : _ref5$expanded;
|
|
115
171
|
var title = 'Data Dictionary';
|
|
116
172
|
if (isEmpty(schema)) {
|
|
117
173
|
title = title + ' Unavailable';
|
|
@@ -121,7 +177,7 @@ var _default = exports.default = function _default(_ref4) {
|
|
|
121
177
|
}, /*#__PURE__*/_react.default.createElement(_collapsableBox.default, {
|
|
122
178
|
title: title,
|
|
123
179
|
expanded: expanded
|
|
124
|
-
}, !isEmpty(schema) && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(
|
|
180
|
+
}, !isEmpty(schema) && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_SchemaTable, {
|
|
125
181
|
schema: schema
|
|
126
182
|
}), viewLink(datasetId))));
|
|
127
183
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { shallow, mount } from 'enzyme'
|
|
2
2
|
import DatasetDictionary from './dataset-dictionary'
|
|
3
3
|
import CollapsableBox from '../collapsable-box'
|
|
4
|
-
import ReactTable from 'react-table'
|
|
5
4
|
import Tooltip from '../tooltip'
|
|
6
5
|
|
|
7
6
|
describe('dataset dictionary', () => {
|
|
@@ -14,7 +13,6 @@ describe('dataset dictionary', () => {
|
|
|
14
13
|
|
|
15
14
|
describe('with a basic schema', () => {
|
|
16
15
|
beforeEach(() => {
|
|
17
|
-
const matchMedia = jest.fn()
|
|
18
16
|
Object.defineProperty(window, 'matchMedia', {
|
|
19
17
|
writable: true,
|
|
20
18
|
value: jest.fn().mockImplementation(query => ({
|
|
@@ -26,7 +24,7 @@ describe('dataset dictionary', () => {
|
|
|
26
24
|
|
|
27
25
|
it('has the correct table headers', () => {
|
|
28
26
|
const table = subject.find('.dataset-schema-table')
|
|
29
|
-
const headers = table.find('
|
|
27
|
+
const headers = table.find('th')
|
|
30
28
|
|
|
31
29
|
expect(headers.length).toBe(4)
|
|
32
30
|
expect(headers.at(1).text()).toBe('Field')
|
|
@@ -36,7 +34,7 @@ describe('dataset dictionary', () => {
|
|
|
36
34
|
|
|
37
35
|
it('has the correct table values', () => {
|
|
38
36
|
const table = subject.find('.dataset-schema-table')
|
|
39
|
-
const cells = table.find('
|
|
37
|
+
const cells = table.find('td')
|
|
40
38
|
|
|
41
39
|
const expansionPlaceholder = ''
|
|
42
40
|
const expectedCellValues = [
|
|
@@ -47,25 +45,18 @@ describe('dataset dictionary', () => {
|
|
|
47
45
|
expectCorrectCellValues(expectedCellValues, cells)
|
|
48
46
|
})
|
|
49
47
|
|
|
50
|
-
it('does not have pagination', () => {
|
|
51
|
-
|
|
52
|
-
expect(table.props().showPagination).toBe(false)
|
|
48
|
+
it('does not have pagination controls', () => {
|
|
49
|
+
expect(subject.find('.pagination').length).toBe(0)
|
|
53
50
|
})
|
|
54
51
|
|
|
55
|
-
it('
|
|
56
|
-
const
|
|
57
|
-
expect(
|
|
52
|
+
it('is sortable via column headers', () => {
|
|
53
|
+
const headers = subject.find('.dataset-schema-table th')
|
|
54
|
+
expect(headers.at(1).prop('onClick')).toBeTruthy()
|
|
58
55
|
})
|
|
59
56
|
|
|
60
|
-
it('
|
|
61
|
-
const
|
|
62
|
-
expect(
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('has no left margin', () => {
|
|
66
|
-
const table = subject.find(ReactTable)
|
|
67
|
-
|
|
68
|
-
expect(table.props().style.marginLeft).toBeFalsy()
|
|
57
|
+
it('has no left margin on the top-level table', () => {
|
|
58
|
+
const tableWrapper = subject.find('.dataset-schema-table').first()
|
|
59
|
+
expect(tableWrapper.prop('style')).toBeFalsy()
|
|
69
60
|
})
|
|
70
61
|
})
|
|
71
62
|
|
|
@@ -78,7 +69,7 @@ describe('dataset dictionary', () => {
|
|
|
78
69
|
subject = mount(<DatasetDictionary schema={schemaWithList} expanded />)
|
|
79
70
|
|
|
80
71
|
const table = subject.find('.dataset-schema-table')
|
|
81
|
-
const cells = table.find('
|
|
72
|
+
const cells = table.find('td')
|
|
82
73
|
|
|
83
74
|
const typeIndex = 2
|
|
84
75
|
expect(cells.at(typeIndex).text()).toBe(`list of ${schemaWithList[0].itemType}`)
|
|
@@ -112,7 +103,7 @@ describe('dataset dictionary', () => {
|
|
|
112
103
|
beforeEach(() => {
|
|
113
104
|
subject = mount(<DatasetDictionary schema={schemaWithMaps} expanded />)
|
|
114
105
|
topLevelTable = subject.find('.dataset-schema-table')
|
|
115
|
-
topLevelCells = topLevelTable.find('
|
|
106
|
+
topLevelCells = topLevelTable.find('td')
|
|
116
107
|
})
|
|
117
108
|
|
|
118
109
|
it('has the correct table values', () => {
|
|
@@ -136,7 +127,7 @@ describe('dataset dictionary', () => {
|
|
|
136
127
|
topLevelTable = subject.find('.dataset-schema-table')
|
|
137
128
|
|
|
138
129
|
subTable = topLevelTable.find('.dataset-schema-table.mother')
|
|
139
|
-
subTableCells = subTable.find('
|
|
130
|
+
subTableCells = subTable.find('td')
|
|
140
131
|
})
|
|
141
132
|
|
|
142
133
|
it('toggles the direction of the arrow', () => {
|
|
@@ -159,7 +150,7 @@ describe('dataset dictionary', () => {
|
|
|
159
150
|
})
|
|
160
151
|
|
|
161
152
|
it('indents the sub table', () => {
|
|
162
|
-
expect(subTable.
|
|
153
|
+
expect(subTable.prop('style').marginLeft).toBe('35px')
|
|
163
154
|
})
|
|
164
155
|
|
|
165
156
|
it('toggles the direction of the arrow again when collapsed', () => {
|
|
@@ -175,7 +166,7 @@ describe('dataset dictionary', () => {
|
|
|
175
166
|
subTable = subject.find('.dataset-schema-table.mother')
|
|
176
167
|
|
|
177
168
|
subSubTable = subTable.find('.dataset-schema-table.children')
|
|
178
|
-
subSubTableCells = subSubTable.find('
|
|
169
|
+
subSubTableCells = subSubTable.find('td')
|
|
179
170
|
})
|
|
180
171
|
|
|
181
172
|
it('renders another sub table for the list of maps with correct values', () => {
|
|
@@ -207,8 +198,8 @@ describe('dataset dictionary', () => {
|
|
|
207
198
|
beforeEach(() => {
|
|
208
199
|
subject = mount(<DatasetDictionary schema={schemaWithMaps} expanded />)
|
|
209
200
|
topLevelTable = subject.find('.dataset-schema-table')
|
|
210
|
-
const
|
|
211
|
-
|
|
201
|
+
const expanderCells = topLevelTable.find('td.expander-td')
|
|
202
|
+
expanderCells.at(1).simulate('click')
|
|
212
203
|
topLevelTable = subject.find('.dataset-schema-table')
|
|
213
204
|
})
|
|
214
205
|
|
|
@@ -276,7 +267,7 @@ describe('dataset dictionary', () => {
|
|
|
276
267
|
|
|
277
268
|
const expectCorrectCellValues = (expectedCellValues, cells) => {
|
|
278
269
|
expectedCellValues.forEach((expected, index) => {
|
|
279
|
-
if (index % 4
|
|
270
|
+
if (index % 4 === 1) { // handle special rendering for field name tooltip
|
|
280
271
|
expect(cells.at(index).find(Tooltip).props().text).toBe(expected)
|
|
281
272
|
} else {
|
|
282
273
|
expect(cells.at(index).text()).toBe(expected)
|