@pingux/astro 2.218.0 → 2.219.0
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/lib/cjs/components/NumberField/NumberField.d.ts +4 -0
- package/lib/cjs/components/NumberField/NumberField.js +21 -93
- package/lib/cjs/components/NumberField/NumberField.styles.d.ts +19 -0
- package/lib/cjs/components/NumberField/index.d.ts +1 -0
- package/lib/cjs/components/TableBase/TableBase.js +12 -6
- package/lib/cjs/components/TableBase/TableBase.mdx +14 -20
- package/lib/cjs/components/TableBase/TableBase.stories.js +148 -2
- package/lib/cjs/components/TableBase/TableBase.styles.d.ts +33 -0
- package/lib/cjs/components/TableBase/TableBase.styles.js +31 -5
- package/lib/cjs/components/TableBase/TableBase.test.js +243 -433
- package/lib/cjs/hooks/useField/useField.d.ts +2 -0
- package/lib/cjs/hooks/useSliderField/useSliderField.d.ts +3 -0
- package/lib/cjs/types/box.d.ts +1 -0
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +35 -24
- package/lib/cjs/types/numberField.d.ts +30 -0
- package/lib/cjs/types/numberField.js +6 -0
- package/lib/components/NumberField/NumberField.js +23 -95
- package/lib/components/TableBase/TableBase.js +12 -6
- package/lib/components/TableBase/TableBase.mdx +14 -20
- package/lib/components/TableBase/TableBase.stories.js +147 -1
- package/lib/components/TableBase/TableBase.styles.js +31 -5
- package/lib/components/TableBase/TableBase.test.js +243 -433
- package/lib/types/index.js +1 -0
- package/lib/types/numberField.js +1 -0
- package/package.json +1 -1
|
@@ -22,7 +22,6 @@ function _regeneratorDefine2(e, r, n, t) { var i = _Object$defineProperty; try {
|
|
|
22
22
|
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
23
23
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
24
24
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
25
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
26
25
|
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
|
|
27
26
|
import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
|
|
28
27
|
import React from 'react';
|
|
@@ -439,7 +438,7 @@ test('Arrow Down key should focus the next row', /*#__PURE__*/_asyncToGenerator(
|
|
|
439
438
|
}, _callee9);
|
|
440
439
|
})));
|
|
441
440
|
test('Arrow Up key should focus the next row', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0() {
|
|
442
|
-
var rows, columnheader;
|
|
441
|
+
var rows, columnheader, headerButton;
|
|
443
442
|
return _regeneratorRuntime().wrap(function _callee0$(_context10) {
|
|
444
443
|
while (1) switch (_context10.prev = _context10.next) {
|
|
445
444
|
case 0:
|
|
@@ -455,9 +454,14 @@ test('Arrow Up key should focus the next row', /*#__PURE__*/_asyncToGenerator(/*
|
|
|
455
454
|
fireEvent.keyUp(rows[1], {
|
|
456
455
|
key: 'ArrowUp'
|
|
457
456
|
});
|
|
457
|
+
|
|
458
|
+
// Column header content is rendered inside a focusable button, so focus
|
|
459
|
+
// moves into that child (focusMode: 'child') rather than the <th> itself.
|
|
458
460
|
columnheader = screen.getAllByRole('columnheader');
|
|
459
|
-
|
|
460
|
-
|
|
461
|
+
headerButton = within(columnheader[0]).getByRole('button');
|
|
462
|
+
expect(headerButton).toHaveFocus();
|
|
463
|
+
expect(columnheader[0]).toHaveClass('is-focused');
|
|
464
|
+
case 11:
|
|
461
465
|
case "end":
|
|
462
466
|
return _context10.stop();
|
|
463
467
|
}
|
|
@@ -953,400 +957,206 @@ describe('Resizable columns', function () {
|
|
|
953
957
|
});
|
|
954
958
|
});
|
|
955
959
|
});
|
|
956
|
-
describe('
|
|
957
|
-
|
|
958
|
-
|
|
960
|
+
describe('Sorting and resizing together', function () {
|
|
961
|
+
var combinedHeaders = [{
|
|
962
|
+
key: 'name',
|
|
963
|
+
name: 'Name'
|
|
964
|
+
}, {
|
|
965
|
+
key: 'value',
|
|
966
|
+
name: 'Value'
|
|
967
|
+
}];
|
|
968
|
+
var combinedObjects = [{
|
|
969
|
+
key: '1',
|
|
970
|
+
name: 'Alpha',
|
|
971
|
+
value: '10'
|
|
972
|
+
}, {
|
|
973
|
+
key: '2',
|
|
974
|
+
name: 'Beta',
|
|
975
|
+
value: '20'
|
|
976
|
+
}];
|
|
977
|
+
var getCombinedTable = function getCombinedTable() {
|
|
978
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
979
|
+
return render(___EmotionJSX(TableBase, _extends({
|
|
980
|
+
"aria-label": "sortable and resizable table"
|
|
981
|
+
}, props), ___EmotionJSX(THead, {
|
|
982
|
+
columns: combinedHeaders
|
|
983
|
+
}, function (head) {
|
|
984
|
+
return ___EmotionJSX(Column, {
|
|
985
|
+
key: head.key,
|
|
986
|
+
allowsSorting: true,
|
|
987
|
+
allowsResizing: true
|
|
988
|
+
}, head.name);
|
|
989
|
+
}), ___EmotionJSX(TBody, {
|
|
990
|
+
items: combinedObjects
|
|
991
|
+
}, function (row) {
|
|
992
|
+
return ___EmotionJSX(Row, {
|
|
993
|
+
key: row.key
|
|
994
|
+
}, function (columnKey) {
|
|
995
|
+
return ___EmotionJSX(Cell, null, row[columnKey]);
|
|
996
|
+
});
|
|
997
|
+
})));
|
|
998
|
+
};
|
|
999
|
+
test('renders both the sort button and resize slider for a column that allows both', function () {
|
|
1000
|
+
getCombinedTable();
|
|
1001
|
+
var columnheaders = screen.getAllByRole('columnheader');
|
|
1002
|
+
var sortButton = within(columnheaders[0]).getByRole('button', {
|
|
1003
|
+
name: /Sort by Name/i
|
|
1004
|
+
});
|
|
1005
|
+
expect(sortButton).toBeInTheDocument();
|
|
1006
|
+
var slider = within(columnheaders[0]).getByRole('slider', {
|
|
1007
|
+
name: /Name column width/i
|
|
1008
|
+
});
|
|
1009
|
+
expect(slider).toBeInTheDocument();
|
|
1010
|
+
});
|
|
1011
|
+
test('resizable table with sorting has no accessibility violations', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
1012
|
+
var _getCombinedTable, container, results;
|
|
959
1013
|
return _regeneratorRuntime().wrap(function _callee12$(_context14) {
|
|
960
1014
|
while (1) switch (_context14.prev = _context14.next) {
|
|
961
1015
|
case 0:
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
1016
|
+
jest.useRealTimers();
|
|
1017
|
+
_getCombinedTable = getCombinedTable({
|
|
1018
|
+
sortDescriptor: {
|
|
1019
|
+
column: 'name',
|
|
1020
|
+
direction: 'ascending'
|
|
1021
|
+
}
|
|
1022
|
+
}), container = _getCombinedTable.container;
|
|
1023
|
+
_context14.next = 4;
|
|
1024
|
+
return axe(container);
|
|
1025
|
+
case 4:
|
|
1026
|
+
results = _context14.sent;
|
|
1027
|
+
jest.useFakeTimers();
|
|
1028
|
+
expect(results).toHaveNoViolations();
|
|
1029
|
+
case 7:
|
|
974
1030
|
case "end":
|
|
975
1031
|
return _context14.stop();
|
|
976
1032
|
}
|
|
977
1033
|
}, _callee12);
|
|
978
1034
|
})));
|
|
979
|
-
test('
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1035
|
+
test('clicking the sort button calls onSortChange without triggering a resize', function () {
|
|
1036
|
+
// TableBase forwards unrecognized props (including onSortChange) onto the
|
|
1037
|
+
// underlying <table> DOM node, which logs a React "unknown prop" warning.
|
|
1038
|
+
// Suppressed here since it's orthogonal to the sort/resize behavior under test.
|
|
1039
|
+
jest.spyOn(console, 'error').mockImplementation();
|
|
1040
|
+
var onSortChange = jest.fn();
|
|
1041
|
+
var onResize = jest.fn();
|
|
1042
|
+
getCombinedTable({
|
|
1043
|
+
onSortChange: onSortChange,
|
|
1044
|
+
onResize: onResize
|
|
984
1045
|
});
|
|
985
|
-
var
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
_forEachInstanceProperty(_context15 = _sliceInstanceProperty(rows).call(rows, 1)).call(_context15, function (row) {
|
|
989
|
-
expect(row).toHaveClass('has-actions');
|
|
1046
|
+
var columnheaders = screen.getAllByRole('columnheader');
|
|
1047
|
+
var sortButton = within(columnheaders[0]).getByRole('button', {
|
|
1048
|
+
name: /Sort by Name/i
|
|
990
1049
|
});
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
var rows = screen.getAllByRole('row');
|
|
996
|
-
_forEachInstanceProperty(_context16 = _sliceInstanceProperty(rows).call(rows, 1)).call(_context16, function (row) {
|
|
997
|
-
expect(row).not.toHaveClass('has-actions');
|
|
1050
|
+
fireEvent.click(sortButton);
|
|
1051
|
+
expect(onSortChange).toHaveBeenCalledWith({
|
|
1052
|
+
column: 'name',
|
|
1053
|
+
direction: 'ascending'
|
|
998
1054
|
});
|
|
1055
|
+
expect(onResize).not.toHaveBeenCalled();
|
|
999
1056
|
});
|
|
1000
|
-
test('
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
onRowAction = jest.fn();
|
|
1006
|
-
getComponent({
|
|
1007
|
-
selectionMode: 'none',
|
|
1008
|
-
onRowAction: onRowAction
|
|
1009
|
-
});
|
|
1010
|
-
rows = screen.getAllByRole('row');
|
|
1011
|
-
_context17.next = 5;
|
|
1012
|
-
return userEvent.tab();
|
|
1013
|
-
case 5:
|
|
1014
|
-
expect(rows[1]).toHaveFocus();
|
|
1015
|
-
|
|
1016
|
-
// React Aria's usePress fires the action on keyUp (press completion),
|
|
1017
|
-
// so both keyDown and keyUp must be fired.
|
|
1018
|
-
fireEvent.keyDown(rows[1], {
|
|
1019
|
-
key: 'Enter'
|
|
1020
|
-
});
|
|
1021
|
-
fireEvent.keyUp(rows[1], {
|
|
1022
|
-
key: 'Enter'
|
|
1023
|
-
});
|
|
1024
|
-
expect(onRowAction).toHaveBeenCalledTimes(1);
|
|
1025
|
-
expect(onRowAction).toHaveBeenCalledWith('1');
|
|
1026
|
-
case 10:
|
|
1027
|
-
case "end":
|
|
1028
|
-
return _context17.stop();
|
|
1029
|
-
}
|
|
1030
|
-
}, _callee13);
|
|
1031
|
-
})));
|
|
1032
|
-
test('clicking an action row applies is-focused class to that row', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
1033
|
-
var onRowAction, rows, firstBodyRowCells, secondBodyRowCells;
|
|
1034
|
-
return _regeneratorRuntime().wrap(function _callee14$(_context18) {
|
|
1035
|
-
while (1) switch (_context18.prev = _context18.next) {
|
|
1036
|
-
case 0:
|
|
1037
|
-
onRowAction = jest.fn();
|
|
1038
|
-
getComponent({
|
|
1039
|
-
onRowAction: onRowAction
|
|
1040
|
-
});
|
|
1041
|
-
rows = screen.getAllByRole('row'); // Click a cell in the first body row (rows[0] is the header row)
|
|
1042
|
-
firstBodyRowCells = rows[1].querySelectorAll('td');
|
|
1043
|
-
_context18.next = 6;
|
|
1044
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1045
|
-
case 6:
|
|
1046
|
-
// First body row should have is-focused; all other body rows should not
|
|
1047
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1048
|
-
expect(rows[2]).not.toHaveClass('is-focused');
|
|
1049
|
-
expect(rows[3]).not.toHaveClass('is-focused');
|
|
1050
|
-
expect(rows[4]).not.toHaveClass('is-focused');
|
|
1051
|
-
|
|
1052
|
-
// Click a cell in the second body row — highlight should move
|
|
1053
|
-
secondBodyRowCells = rows[2].querySelectorAll('td');
|
|
1054
|
-
_context18.next = 13;
|
|
1055
|
-
return userEvent.click(secondBodyRowCells[0]);
|
|
1056
|
-
case 13:
|
|
1057
|
-
expect(rows[2]).toHaveClass('is-focused');
|
|
1058
|
-
expect(rows[1]).not.toHaveClass('is-focused');
|
|
1059
|
-
case 15:
|
|
1060
|
-
case "end":
|
|
1061
|
-
return _context18.stop();
|
|
1057
|
+
test('sets aria-sort on a column header that also allows resizing', function () {
|
|
1058
|
+
getCombinedTable({
|
|
1059
|
+
sortDescriptor: {
|
|
1060
|
+
column: 'name',
|
|
1061
|
+
direction: 'ascending'
|
|
1062
1062
|
}
|
|
1063
|
-
}, _callee14);
|
|
1064
|
-
})));
|
|
1065
|
-
test('no row has is-focused before any click with onRowAction', function () {
|
|
1066
|
-
var _context19;
|
|
1067
|
-
var onRowAction = jest.fn();
|
|
1068
|
-
getComponent({
|
|
1069
|
-
onRowAction: onRowAction
|
|
1070
1063
|
});
|
|
1071
|
-
var
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1064
|
+
var columnheaders = screen.getAllByRole('columnheader');
|
|
1065
|
+
expect(columnheaders[0]).toHaveAttribute('aria-sort', 'ascending');
|
|
1066
|
+
expect(columnheaders[1]).toHaveAttribute('aria-sort', 'none');
|
|
1067
|
+
});
|
|
1068
|
+
test('resizing via the slider does not call onSortChange', function () {
|
|
1069
|
+
jest.spyOn(console, 'error').mockImplementation();
|
|
1070
|
+
var onSortChange = jest.fn();
|
|
1071
|
+
var onResize = jest.fn();
|
|
1072
|
+
getCombinedTable({
|
|
1073
|
+
onSortChange: onSortChange,
|
|
1074
|
+
onResize: onResize
|
|
1075
|
+
});
|
|
1076
|
+
var columnheaders = screen.getAllByRole('columnheader');
|
|
1077
|
+
var slider = within(columnheaders[0]).getByRole('slider', {
|
|
1078
|
+
name: /Name column width/i
|
|
1076
1079
|
});
|
|
1080
|
+
actHooks(function () {
|
|
1081
|
+
slider.focus();
|
|
1082
|
+
});
|
|
1083
|
+
fireEvent.keyDown(slider, {
|
|
1084
|
+
key: 'Enter'
|
|
1085
|
+
});
|
|
1086
|
+
fireEvent.keyDown(slider, {
|
|
1087
|
+
key: 'ArrowRight'
|
|
1088
|
+
});
|
|
1089
|
+
expect(onResize).toHaveBeenCalledTimes(1);
|
|
1090
|
+
expect(onSortChange).not.toHaveBeenCalled();
|
|
1077
1091
|
});
|
|
1078
|
-
test('
|
|
1079
|
-
var
|
|
1080
|
-
return _regeneratorRuntime().wrap(function
|
|
1081
|
-
while (1) switch (
|
|
1082
|
-
case 0:
|
|
1083
|
-
getComponent();
|
|
1084
|
-
rows = screen.getAllByRole('row');
|
|
1085
|
-
firstBodyRowCells = rows[1].querySelectorAll('td');
|
|
1086
|
-
_context20.next = 5;
|
|
1087
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1088
|
-
case 5:
|
|
1089
|
-
// Without onRowAction the active-row path is not triggered
|
|
1090
|
-
expect(rows[1]).not.toHaveClass('is-focused');
|
|
1091
|
-
case 6:
|
|
1092
|
-
case "end":
|
|
1093
|
-
return _context20.stop();
|
|
1094
|
-
}
|
|
1095
|
-
}, _callee15);
|
|
1096
|
-
})));
|
|
1097
|
-
test('keyboard-focused row receives is-focused when onRowAction is present (AC4)', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
1098
|
-
var onRowAction, rows;
|
|
1099
|
-
return _regeneratorRuntime().wrap(function _callee16$(_context21) {
|
|
1100
|
-
while (1) switch (_context21.prev = _context21.next) {
|
|
1092
|
+
test('sort button and resize slider are independently focusable within the same column header', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
1093
|
+
var columnheaders, sortButton, slider, rows;
|
|
1094
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context15) {
|
|
1095
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1101
1096
|
case 0:
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1097
|
+
getCombinedTable();
|
|
1098
|
+
columnheaders = screen.getAllByRole('columnheader');
|
|
1099
|
+
sortButton = within(columnheaders[0]).getByRole('button', {
|
|
1100
|
+
name: /Sort by Name/i
|
|
1106
1101
|
});
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
return userEvent.tab();
|
|
1110
|
-
case 5:
|
|
1111
|
-
expect(rows[1]).toHaveFocus();
|
|
1112
|
-
|
|
1113
|
-
// The row must have is-focused from keyboard focus (isFocusVisible path unchanged)
|
|
1114
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1115
|
-
case 7:
|
|
1116
|
-
case "end":
|
|
1117
|
-
return _context21.stop();
|
|
1118
|
-
}
|
|
1119
|
-
}, _callee16);
|
|
1120
|
-
})));
|
|
1121
|
-
test('is-focused class appears only once when keyboard-focused row is also the active row (AC5)', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1122
|
-
var _context22;
|
|
1123
|
-
var onRowAction, rows, firstBodyRowCells, isFocusedCount;
|
|
1124
|
-
return _regeneratorRuntime().wrap(function _callee17$(_context23) {
|
|
1125
|
-
while (1) switch (_context23.prev = _context23.next) {
|
|
1126
|
-
case 0:
|
|
1127
|
-
onRowAction = jest.fn();
|
|
1128
|
-
getComponent({
|
|
1129
|
-
selectionMode: 'none',
|
|
1130
|
-
onRowAction: onRowAction
|
|
1131
|
-
});
|
|
1132
|
-
rows = screen.getAllByRole('row'); // Click the first body row to set activeRowKey
|
|
1133
|
-
firstBodyRowCells = rows[1].querySelectorAll('td');
|
|
1134
|
-
_context23.next = 6;
|
|
1135
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1136
|
-
case 6:
|
|
1137
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1138
|
-
|
|
1139
|
-
// Count occurrences of the class — must be exactly 1
|
|
1140
|
-
isFocusedCount = _filterInstanceProperty(_context22 = rows[1].className.split(/\s+/)).call(_context22, function (cls) {
|
|
1141
|
-
return cls === 'is-focused';
|
|
1142
|
-
}).length;
|
|
1143
|
-
expect(isFocusedCount).toBe(1);
|
|
1144
|
-
case 9:
|
|
1145
|
-
case "end":
|
|
1146
|
-
return _context23.stop();
|
|
1147
|
-
}
|
|
1148
|
-
}, _callee17);
|
|
1149
|
-
})));
|
|
1150
|
-
test('clicking a row focuses the row <tr> so arrow keys work via React Aria', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1151
|
-
var onRowAction, rows, firstBodyRowCells;
|
|
1152
|
-
return _regeneratorRuntime().wrap(function _callee18$(_context24) {
|
|
1153
|
-
while (1) switch (_context24.prev = _context24.next) {
|
|
1154
|
-
case 0:
|
|
1155
|
-
onRowAction = jest.fn();
|
|
1156
|
-
getComponent({
|
|
1157
|
-
onRowAction: onRowAction
|
|
1158
|
-
});
|
|
1159
|
-
rows = screen.getAllByRole('row'); // Click a cell in the first body row
|
|
1160
|
-
firstBodyRowCells = rows[1].querySelectorAll('td');
|
|
1161
|
-
_context24.next = 6;
|
|
1162
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1163
|
-
case 6:
|
|
1164
|
-
// The <tr> for the clicked row should now have DOM focus
|
|
1165
|
-
expect(rows[1]).toHaveFocus();
|
|
1166
|
-
|
|
1167
|
-
// Arrow keys should then navigate via React Aria
|
|
1168
|
-
fireEvent.keyDown(rows[1], {
|
|
1169
|
-
key: 'ArrowDown'
|
|
1170
|
-
});
|
|
1171
|
-
fireEvent.keyUp(rows[1], {
|
|
1172
|
-
key: 'ArrowDown'
|
|
1173
|
-
});
|
|
1174
|
-
expect(rows[2]).toHaveFocus();
|
|
1175
|
-
case 10:
|
|
1176
|
-
case "end":
|
|
1177
|
-
return _context24.stop();
|
|
1178
|
-
}
|
|
1179
|
-
}, _callee18);
|
|
1180
|
-
})));
|
|
1181
|
-
test('is-focused (active border) clears when focus leaves the table', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1182
|
-
var onRowAction, rows, firstBodyRowCells;
|
|
1183
|
-
return _regeneratorRuntime().wrap(function _callee19$(_context25) {
|
|
1184
|
-
while (1) switch (_context25.prev = _context25.next) {
|
|
1185
|
-
case 0:
|
|
1186
|
-
onRowAction = jest.fn();
|
|
1187
|
-
getComponent({
|
|
1188
|
-
onRowAction: onRowAction
|
|
1189
|
-
});
|
|
1190
|
-
rows = screen.getAllByRole('row'); // Click a cell in the first body row to set activeRowKey
|
|
1191
|
-
firstBodyRowCells = rows[1].querySelectorAll('td');
|
|
1192
|
-
_context25.next = 6;
|
|
1193
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1194
|
-
case 6:
|
|
1195
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1196
|
-
|
|
1197
|
-
// Flush the setTimeout(0) that resets actionJustFired so the blur handler
|
|
1198
|
-
// can proceed normally for genuine focus-out events.
|
|
1199
|
-
actHooks(function () {
|
|
1200
|
-
jest.runAllTimers();
|
|
1201
|
-
});
|
|
1202
|
-
|
|
1203
|
-
// Use focusOut (which bubbles) to reach the onBlur handler on the scroll
|
|
1204
|
-
// container, simulating focus leaving the table entirely.
|
|
1205
|
-
fireEvent.focusOut(rows[1], {
|
|
1206
|
-
relatedTarget: null
|
|
1207
|
-
});
|
|
1208
|
-
|
|
1209
|
-
// is-focused should be cleared
|
|
1210
|
-
expect(rows[1]).not.toHaveClass('is-focused');
|
|
1211
|
-
case 10:
|
|
1212
|
-
case "end":
|
|
1213
|
-
return _context25.stop();
|
|
1214
|
-
}
|
|
1215
|
-
}, _callee19);
|
|
1216
|
-
})));
|
|
1217
|
-
test('clicking an already-active row toggles activeRowKey off (clears is-focused)', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
1218
|
-
var onRowAction, rows, firstBodyRowCells;
|
|
1219
|
-
return _regeneratorRuntime().wrap(function _callee20$(_context26) {
|
|
1220
|
-
while (1) switch (_context26.prev = _context26.next) {
|
|
1221
|
-
case 0:
|
|
1222
|
-
onRowAction = jest.fn();
|
|
1223
|
-
getComponent({
|
|
1224
|
-
onRowAction: onRowAction
|
|
1225
|
-
});
|
|
1226
|
-
rows = screen.getAllByRole('row');
|
|
1227
|
-
firstBodyRowCells = rows[1].querySelectorAll('td'); // First click sets the row as active
|
|
1228
|
-
_context26.next = 6;
|
|
1229
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1230
|
-
case 6:
|
|
1231
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1232
|
-
|
|
1233
|
-
// Second click on the same row should toggle it off
|
|
1234
|
-
_context26.next = 9;
|
|
1235
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1236
|
-
case 9:
|
|
1237
|
-
expect(rows[1]).not.toHaveClass('is-focused');
|
|
1238
|
-
case 10:
|
|
1239
|
-
case "end":
|
|
1240
|
-
return _context26.stop();
|
|
1241
|
-
}
|
|
1242
|
-
}, _callee20);
|
|
1243
|
-
})));
|
|
1244
|
-
test('active-row highlight does not clear when focus moves to an overlay panel', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
1245
|
-
var onRowAction, rows, firstBodyRowCells, panelButton;
|
|
1246
|
-
return _regeneratorRuntime().wrap(function _callee21$(_context27) {
|
|
1247
|
-
while (1) switch (_context27.prev = _context27.next) {
|
|
1248
|
-
case 0:
|
|
1249
|
-
onRowAction = jest.fn();
|
|
1250
|
-
getComponent({
|
|
1251
|
-
onRowAction: onRowAction
|
|
1102
|
+
slider = within(columnheaders[0]).getByRole('slider', {
|
|
1103
|
+
name: /Name column width/i
|
|
1252
1104
|
});
|
|
1253
|
-
rows = screen.getAllByRole('row'); //
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1257
|
-
case 6:
|
|
1258
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1259
|
-
|
|
1260
|
-
// Simulate OverlayPanel FocusScope stealing focus to an element outside the table.
|
|
1261
|
-
// The actionJustFired guard (set synchronously in wrappedOnRowAction) should
|
|
1262
|
-
// absorb this blur and keep the active-row highlight intact.
|
|
1263
|
-
panelButton = document.createElement('button');
|
|
1264
|
-
document.body.appendChild(panelButton);
|
|
1265
|
-
fireEvent.focusOut(rows[1], {
|
|
1266
|
-
relatedTarget: panelButton
|
|
1267
|
-
});
|
|
1268
|
-
|
|
1269
|
-
// Highlight must survive the focus-steal
|
|
1270
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1271
|
-
document.body.removeChild(panelButton);
|
|
1272
|
-
case 12:
|
|
1273
|
-
case "end":
|
|
1274
|
-
return _context27.stop();
|
|
1275
|
-
}
|
|
1276
|
-
}, _callee21);
|
|
1277
|
-
})));
|
|
1278
|
-
test('Enter key on a focused action row applies is-focused to that row', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
1279
|
-
var onRowAction, rows;
|
|
1280
|
-
return _regeneratorRuntime().wrap(function _callee22$(_context28) {
|
|
1281
|
-
while (1) switch (_context28.prev = _context28.next) {
|
|
1282
|
-
case 0:
|
|
1283
|
-
onRowAction = jest.fn();
|
|
1284
|
-
getComponent({
|
|
1285
|
-
selectionMode: 'none',
|
|
1286
|
-
onRowAction: onRowAction
|
|
1287
|
-
});
|
|
1288
|
-
rows = screen.getAllByRole('row'); // Tab to put keyboard focus on the first body row
|
|
1289
|
-
_context28.next = 5;
|
|
1105
|
+
rows = screen.getAllByRole('row'); // Tab into the first body row, then ArrowUp moves focus into the
|
|
1106
|
+
// column header's focusable child (the sort button, per focusMode: 'child').
|
|
1107
|
+
_context15.next = 7;
|
|
1290
1108
|
return userEvent.tab();
|
|
1291
|
-
case
|
|
1109
|
+
case 7:
|
|
1292
1110
|
expect(rows[1]).toHaveFocus();
|
|
1293
|
-
|
|
1294
|
-
// Press Enter to trigger onRowAction via keyboard
|
|
1295
1111
|
fireEvent.keyDown(rows[1], {
|
|
1296
|
-
key: '
|
|
1112
|
+
key: 'ArrowUp'
|
|
1297
1113
|
});
|
|
1298
1114
|
fireEvent.keyUp(rows[1], {
|
|
1299
|
-
key: '
|
|
1300
|
-
});
|
|
1301
|
-
expect(onRowAction).toHaveBeenCalledWith('1');
|
|
1302
|
-
|
|
1303
|
-
// The row should carry is-focused (active-row state set from keyboard action)
|
|
1304
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1305
|
-
case 10:
|
|
1306
|
-
case "end":
|
|
1307
|
-
return _context28.stop();
|
|
1308
|
-
}
|
|
1309
|
-
}, _callee22);
|
|
1310
|
-
})));
|
|
1311
|
-
test('active-row highlight clears when arrow keys move focus to another row', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
1312
|
-
var onRowAction, rows, firstBodyRowCells;
|
|
1313
|
-
return _regeneratorRuntime().wrap(function _callee23$(_context29) {
|
|
1314
|
-
while (1) switch (_context29.prev = _context29.next) {
|
|
1315
|
-
case 0:
|
|
1316
|
-
onRowAction = jest.fn();
|
|
1317
|
-
getComponent({
|
|
1318
|
-
onRowAction: onRowAction
|
|
1115
|
+
key: 'ArrowUp'
|
|
1319
1116
|
});
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
return userEvent.click(firstBodyRowCells[0]);
|
|
1324
|
-
case 6:
|
|
1325
|
-
// Flush the setTimeout(0) guard so subsequent focus events are not swallowed
|
|
1326
|
-
actHooks(function () {
|
|
1327
|
-
jest.runAllTimers();
|
|
1328
|
-
});
|
|
1329
|
-
expect(rows[1]).toHaveClass('is-focused');
|
|
1330
|
-
|
|
1331
|
-
// Simulate the panel closing by returning focus to the row
|
|
1332
|
-
fireEvent.focus(rows[1]);
|
|
1333
|
-
|
|
1334
|
-
// Arrow Down moves focus to row 2 — row 1 should lose is-focused
|
|
1335
|
-
fireEvent.keyDown(rows[1], {
|
|
1336
|
-
key: 'ArrowDown'
|
|
1117
|
+
expect(sortButton).toHaveFocus();
|
|
1118
|
+
fireEvent.keyDown(columnheaders[0], {
|
|
1119
|
+
key: 'ArrowRight'
|
|
1337
1120
|
});
|
|
1338
|
-
fireEvent.keyUp(
|
|
1339
|
-
key: '
|
|
1121
|
+
fireEvent.keyUp(columnheaders[0], {
|
|
1122
|
+
key: 'ArrowRight'
|
|
1340
1123
|
});
|
|
1341
|
-
|
|
1342
|
-
expect(rows[1]).not.toHaveClass('is-focused');
|
|
1343
|
-
expect(rows[2]).toHaveFocus();
|
|
1124
|
+
expect(slider).toHaveFocus();
|
|
1344
1125
|
case 14:
|
|
1345
1126
|
case "end":
|
|
1346
|
-
return
|
|
1127
|
+
return _context15.stop();
|
|
1347
1128
|
}
|
|
1348
|
-
},
|
|
1129
|
+
}, _callee13);
|
|
1349
1130
|
})));
|
|
1131
|
+
test('resizing a column does not change its sort state', function () {
|
|
1132
|
+
jest.spyOn(console, 'error').mockImplementation();
|
|
1133
|
+
var onSortChange = jest.fn();
|
|
1134
|
+
getCombinedTable({
|
|
1135
|
+
onSortChange: onSortChange,
|
|
1136
|
+
sortDescriptor: {
|
|
1137
|
+
column: 'name',
|
|
1138
|
+
direction: 'ascending'
|
|
1139
|
+
}
|
|
1140
|
+
});
|
|
1141
|
+
var columnheaders = screen.getAllByRole('columnheader');
|
|
1142
|
+
var slider = within(columnheaders[0]).getByRole('slider', {
|
|
1143
|
+
name: /Name column width/i
|
|
1144
|
+
});
|
|
1145
|
+
actHooks(function () {
|
|
1146
|
+
slider.focus();
|
|
1147
|
+
});
|
|
1148
|
+
fireEvent.keyDown(slider, {
|
|
1149
|
+
key: 'Enter'
|
|
1150
|
+
});
|
|
1151
|
+
fireEvent.keyDown(slider, {
|
|
1152
|
+
key: 'ArrowRight'
|
|
1153
|
+
});
|
|
1154
|
+
fireEvent.keyDown(slider, {
|
|
1155
|
+
key: 'Escape'
|
|
1156
|
+
});
|
|
1157
|
+
expect(columnheaders[0]).toHaveAttribute('aria-sort', 'ascending');
|
|
1158
|
+
expect(onSortChange).not.toHaveBeenCalled();
|
|
1159
|
+
});
|
|
1350
1160
|
});
|
|
1351
1161
|
describe('Sortable Table with useAsyncList', function () {
|
|
1352
1162
|
var dataTestId = 'sortableTable';
|
|
@@ -1360,18 +1170,18 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1360
1170
|
return _load.apply(this, arguments);
|
|
1361
1171
|
}
|
|
1362
1172
|
function _load() {
|
|
1363
|
-
_load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1364
|
-
return _regeneratorRuntime().wrap(function
|
|
1365
|
-
while (1) switch (
|
|
1173
|
+
_load = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
1174
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context26) {
|
|
1175
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1366
1176
|
case 0:
|
|
1367
|
-
return
|
|
1177
|
+
return _context26.abrupt("return", {
|
|
1368
1178
|
items: objects
|
|
1369
1179
|
});
|
|
1370
1180
|
case 1:
|
|
1371
1181
|
case "end":
|
|
1372
|
-
return
|
|
1182
|
+
return _context26.stop();
|
|
1373
1183
|
}
|
|
1374
|
-
},
|
|
1184
|
+
}, _callee22);
|
|
1375
1185
|
}));
|
|
1376
1186
|
return _load.apply(this, arguments);
|
|
1377
1187
|
}
|
|
@@ -1379,13 +1189,13 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1379
1189
|
return _sort.apply(this, arguments);
|
|
1380
1190
|
}
|
|
1381
1191
|
function _sort() {
|
|
1382
|
-
_sort = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1383
|
-
var
|
|
1384
|
-
return _regeneratorRuntime().wrap(function
|
|
1385
|
-
while (1) switch (
|
|
1192
|
+
_sort = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(list) {
|
|
1193
|
+
var _context27;
|
|
1194
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context28) {
|
|
1195
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1386
1196
|
case 0:
|
|
1387
1197
|
// eslint-disable-next-line no-param-reassign
|
|
1388
|
-
list.items = _sortInstanceProperty(
|
|
1198
|
+
list.items = _sortInstanceProperty(_context27 = list.items).call(_context27, function (a, b) {
|
|
1389
1199
|
var first = a[list.sortDescriptor.column];
|
|
1390
1200
|
var second = b[list.sortDescriptor.column];
|
|
1391
1201
|
var cmp = (_parseInt(first) || first) < (_parseInt(second) || second) // eslint-disable-line
|
|
@@ -1395,17 +1205,17 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1395
1205
|
}
|
|
1396
1206
|
return cmp;
|
|
1397
1207
|
});
|
|
1398
|
-
return
|
|
1208
|
+
return _context28.abrupt("return", list);
|
|
1399
1209
|
case 2:
|
|
1400
1210
|
case "end":
|
|
1401
|
-
return
|
|
1211
|
+
return _context28.stop();
|
|
1402
1212
|
}
|
|
1403
|
-
},
|
|
1213
|
+
}, _callee23);
|
|
1404
1214
|
}));
|
|
1405
1215
|
return _sort.apply(this, arguments);
|
|
1406
1216
|
}
|
|
1407
|
-
var sortableDataTable = function sortableDataTable(
|
|
1408
|
-
var result =
|
|
1217
|
+
var sortableDataTable = function sortableDataTable(_ref14) {
|
|
1218
|
+
var result = _ref14.result;
|
|
1409
1219
|
return render(___EmotionJSX(TableBase, _extends({}, defaultTableProps, {
|
|
1410
1220
|
sortDescriptor: result.current.sortDescriptor
|
|
1411
1221
|
}), ___EmotionJSX(THead, {
|
|
@@ -1422,10 +1232,10 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1422
1232
|
});
|
|
1423
1233
|
})));
|
|
1424
1234
|
};
|
|
1425
|
-
test('sort by country column A => Z', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1235
|
+
test('sort by country column A => Z', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1426
1236
|
var _renderHook, result, sortableTable, rowgroups, thead, headerCells, tRows;
|
|
1427
|
-
return _regeneratorRuntime().wrap(function
|
|
1428
|
-
while (1) switch (
|
|
1237
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context20) {
|
|
1238
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1429
1239
|
case 0:
|
|
1430
1240
|
_renderHook = renderHook(function () {
|
|
1431
1241
|
return useAsyncList({
|
|
@@ -1437,47 +1247,47 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1437
1247
|
}
|
|
1438
1248
|
});
|
|
1439
1249
|
}), result = _renderHook.result;
|
|
1440
|
-
|
|
1441
|
-
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1442
|
-
return _regeneratorRuntime().wrap(function
|
|
1443
|
-
while (1) switch (
|
|
1250
|
+
_context20.next = 3;
|
|
1251
|
+
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
1252
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context16) {
|
|
1253
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1444
1254
|
case 0:
|
|
1445
1255
|
jest.runOnlyPendingTimers();
|
|
1446
1256
|
case 1:
|
|
1447
1257
|
case "end":
|
|
1448
|
-
return
|
|
1258
|
+
return _context16.stop();
|
|
1449
1259
|
}
|
|
1450
|
-
},
|
|
1260
|
+
}, _callee14);
|
|
1451
1261
|
})));
|
|
1452
1262
|
case 3:
|
|
1453
|
-
|
|
1454
|
-
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1455
|
-
var
|
|
1456
|
-
return _regeneratorRuntime().wrap(function
|
|
1457
|
-
while (1) switch (
|
|
1263
|
+
_context20.next = 5;
|
|
1264
|
+
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
1265
|
+
var _context17;
|
|
1266
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context18) {
|
|
1267
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1458
1268
|
case 0:
|
|
1459
|
-
_sortInstanceProperty(
|
|
1269
|
+
_sortInstanceProperty(_context17 = result.current).call(_context17, {
|
|
1460
1270
|
column: 'country',
|
|
1461
1271
|
direction: 'ascending'
|
|
1462
1272
|
});
|
|
1463
1273
|
case 1:
|
|
1464
1274
|
case "end":
|
|
1465
|
-
return
|
|
1275
|
+
return _context18.stop();
|
|
1466
1276
|
}
|
|
1467
|
-
},
|
|
1277
|
+
}, _callee15);
|
|
1468
1278
|
})));
|
|
1469
1279
|
case 5:
|
|
1470
|
-
|
|
1471
|
-
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1472
|
-
return _regeneratorRuntime().wrap(function
|
|
1473
|
-
while (1) switch (
|
|
1280
|
+
_context20.next = 7;
|
|
1281
|
+
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
1282
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context19) {
|
|
1283
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1474
1284
|
case 0:
|
|
1475
1285
|
jest.runOnlyPendingTimers();
|
|
1476
1286
|
case 1:
|
|
1477
1287
|
case "end":
|
|
1478
|
-
return
|
|
1288
|
+
return _context19.stop();
|
|
1479
1289
|
}
|
|
1480
|
-
},
|
|
1290
|
+
}, _callee16);
|
|
1481
1291
|
})));
|
|
1482
1292
|
case 7:
|
|
1483
1293
|
sortableDataTable({
|
|
@@ -1505,14 +1315,14 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1505
1315
|
expect(tRows[3]).toHaveTextContent('USA');
|
|
1506
1316
|
case 28:
|
|
1507
1317
|
case "end":
|
|
1508
|
-
return
|
|
1318
|
+
return _context20.stop();
|
|
1509
1319
|
}
|
|
1510
|
-
},
|
|
1320
|
+
}, _callee17);
|
|
1511
1321
|
})));
|
|
1512
|
-
test('sort by country column Z => A', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1322
|
+
test('sort by country column Z => A', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
1513
1323
|
var _renderHook2, result, sortableTable, rowgroups, tRows;
|
|
1514
|
-
return _regeneratorRuntime().wrap(function
|
|
1515
|
-
while (1) switch (
|
|
1324
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context25) {
|
|
1325
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1516
1326
|
case 0:
|
|
1517
1327
|
_renderHook2 = renderHook(function () {
|
|
1518
1328
|
return useAsyncList({
|
|
@@ -1524,47 +1334,47 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1524
1334
|
}
|
|
1525
1335
|
});
|
|
1526
1336
|
}), result = _renderHook2.result;
|
|
1527
|
-
|
|
1528
|
-
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1529
|
-
return _regeneratorRuntime().wrap(function
|
|
1530
|
-
while (1) switch (
|
|
1337
|
+
_context25.next = 3;
|
|
1338
|
+
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1339
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context21) {
|
|
1340
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1531
1341
|
case 0:
|
|
1532
1342
|
jest.runOnlyPendingTimers();
|
|
1533
1343
|
case 1:
|
|
1534
1344
|
case "end":
|
|
1535
|
-
return
|
|
1345
|
+
return _context21.stop();
|
|
1536
1346
|
}
|
|
1537
|
-
},
|
|
1347
|
+
}, _callee18);
|
|
1538
1348
|
})));
|
|
1539
1349
|
case 3:
|
|
1540
|
-
|
|
1541
|
-
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1542
|
-
var
|
|
1543
|
-
return _regeneratorRuntime().wrap(function
|
|
1544
|
-
while (1) switch (
|
|
1350
|
+
_context25.next = 5;
|
|
1351
|
+
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1352
|
+
var _context22;
|
|
1353
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context23) {
|
|
1354
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1545
1355
|
case 0:
|
|
1546
|
-
_sortInstanceProperty(
|
|
1356
|
+
_sortInstanceProperty(_context22 = result.current).call(_context22, {
|
|
1547
1357
|
column: 'country',
|
|
1548
1358
|
direction: 'descending'
|
|
1549
1359
|
});
|
|
1550
1360
|
case 1:
|
|
1551
1361
|
case "end":
|
|
1552
|
-
return
|
|
1362
|
+
return _context23.stop();
|
|
1553
1363
|
}
|
|
1554
|
-
},
|
|
1364
|
+
}, _callee19);
|
|
1555
1365
|
})));
|
|
1556
1366
|
case 5:
|
|
1557
|
-
|
|
1558
|
-
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1559
|
-
return _regeneratorRuntime().wrap(function
|
|
1560
|
-
while (1) switch (
|
|
1367
|
+
_context25.next = 7;
|
|
1368
|
+
return actHooks(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
1369
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context24) {
|
|
1370
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1561
1371
|
case 0:
|
|
1562
1372
|
jest.runOnlyPendingTimers();
|
|
1563
1373
|
case 1:
|
|
1564
1374
|
case "end":
|
|
1565
|
-
return
|
|
1375
|
+
return _context24.stop();
|
|
1566
1376
|
}
|
|
1567
|
-
},
|
|
1377
|
+
}, _callee20);
|
|
1568
1378
|
})));
|
|
1569
1379
|
case 7:
|
|
1570
1380
|
sortableDataTable({
|
|
@@ -1588,8 +1398,8 @@ describe('Sortable Table with useAsyncList', function () {
|
|
|
1588
1398
|
expect(tRows[3]).toHaveTextContent('Canada');
|
|
1589
1399
|
case 24:
|
|
1590
1400
|
case "end":
|
|
1591
|
-
return
|
|
1401
|
+
return _context25.stop();
|
|
1592
1402
|
}
|
|
1593
|
-
},
|
|
1403
|
+
}, _callee21);
|
|
1594
1404
|
})));
|
|
1595
1405
|
});
|