import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _extends from "@babel/runtime/helpers/extends";
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/Table/DataTable/test/DataTable.spec.jsx";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import _regeneratorRuntime from "@babel/runtime/regenerator";
import React from 'react';
import { createRendererWithUniDriver, cleanup, waitFor } from '../../../utils/test-utils/react';
import DataTable from '../DataTable';
import { dataTableUniDriverFactory } from '../DataTable.uni.driver';
import WixStyleReactMaskingProvider from '../../../WixStyleReactMaskingProvider';
describe('Table', function () {
  describe('[async]', function () {
    runTests(createRendererWithUniDriver(dataTableUniDriverFactory));
  });
  function runTests(render) {
    var _this = this;
    afterEach(function () {
      return cleanup();
    });
    var createDriver = function createDriver(jsx) {
      return render(jsx).driver;
    };
    var createDefaultProps = function createDefaultProps() {
      return {
        id: 'id',
        data: [{
          a: 'value 1',
          b: 'value 2'
        }, {
          a: 'value 3',
          b: 'value 4'
        }],
        columns: [{
          title: 'Row Num',
          render: function render(row, rowNum) {
            return rowNum;
          }
        }, {
          title: 'A',
          render: function render(row) {
            return row.a;
          }
        }, {
          title: 'B',
          render: function render(row) {
            return row.b;
          }
        }],
        rowClass: 'class-name'
      };
    };
    var defaultProps = createDefaultProps();
    it('should pass id prop to child', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 38,
                columnNumber: 35
              }
            })));
            _context.t0 = expect;
            _context.next = 4;
            return driver.hasChildWithId(defaultProps.id);
          case 4:
            _context.t1 = _context.sent;
            (0, _context.t0)(_context.t1).toBe(true);
          case 6:
          case "end":
            return _context.stop();
        }
      }, _callee);
    })));
    describe('data is empty', function () {
      var rowDataHook = 'row-data-hook';
      var props = _objectSpread(_objectSpread({}, defaultProps), {}, {
        data: [],
        rowDataHook: rowDataHook
      });
      it('should not render the component when no data supplied', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 47,
                  columnNumber: 37
                }
              })));
              _context2.t0 = expect;
              _context2.next = 4;
              return driver.exists();
            case 4:
              _context2.t1 = _context2.sent;
              (0, _context2.t0)(_context2.t1).toEqual(false);
            case 6:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      })));
      it('should render the component when data is supplied', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 52,
                  columnNumber: 37
                }
              })));
              _context3.t0 = expect;
              _context3.next = 4;
              return driver.exists();
            case 4:
              _context3.t1 = _context3.sent;
              (0, _context3.t0)(_context3.t1).toEqual(true);
            case 6:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      })));
      it('should display nothing', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 57,
                  columnNumber: 37
                }
              })));
              _context4.t0 = expect;
              _context4.next = 4;
              return driver.isDisplayingNothing();
            case 4:
              _context4.t1 = _context4.sent;
              (0, _context4.t0)(_context4.t1).toBe(true);
            case 6:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      })));
      it('should count 0 rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee5$(_context5) {
          while (1) switch (_context5.prev = _context5.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 62,
                  columnNumber: 37
                }
              })));
              _context5.t0 = expect;
              _context5.next = 4;
              return driver.getRowsCount();
            case 4:
              _context5.t1 = _context5.sent;
              (0, _context5.t0)(_context5.t1).toEqual(0);
            case 6:
            case "end":
              return _context5.stop();
          }
        }, _callee5);
      })));
      it('should count 0 rows with class name', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee6$(_context6) {
          while (1) switch (_context6.prev = _context6.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 67,
                  columnNumber: 37
                }
              })));
              _context6.t0 = expect;
              _context6.next = 4;
              return driver.getRowsWithClassCount(defaultProps.rowClass);
            case 4:
              _context6.t1 = _context6.sent;
              (0, _context6.t0)(_context6.t1).toEqual(0);
            case 6:
            case "end":
              return _context6.stop();
          }
        }, _callee6);
      })));
      it('should find 0 rows with data-hook', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee7$(_context7) {
          while (1) switch (_context7.prev = _context7.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 74,
                  columnNumber: 37
                }
              })));
              _context7.t0 = expect;
              _context7.next = 4;
              return driver.getRowsWithDataHook(rowDataHook);
            case 4:
              _context7.t1 = _context7.sent;
              (0, _context7.t0)(_context7.t1).toHaveLength(0);
            case 6:
            case "end":
              return _context7.stop();
          }
        }, _callee7);
      })));
      it('should not find a row with data-hook', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee8$(_context8) {
          while (1) switch (_context8.prev = _context8.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 79,
                  columnNumber: 37
                }
              })));
              _context8.t0 = expect;
              _context8.next = 4;
              return driver.getRowWithDataHook(rowDataHook);
            case 4:
              _context8.t1 = _context8.sent;
              (0, _context8.t0)(_context8.t1).toEqual(null);
            case 6:
            case "end":
              return _context8.stop();
          }
        }, _callee8);
      })));
      it('should not a header only', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee9$(_context9) {
          while (1) switch (_context9.prev = _context9.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 84,
                  columnNumber: 37
                }
              })));
              _context9.t0 = expect;
              _context9.next = 4;
              return driver.isDisplayingHeaderOnly();
            case 4:
              _context9.t1 = _context9.sent;
              (0, _context9.t0)(_context9.t1).toBeFalsy();
            case 6:
            case "end":
              return _context9.stop();
          }
        }, _callee9);
      })));
      it('should not a header ', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee0$(_context0) {
          while (1) switch (_context0.prev = _context0.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 89,
                  columnNumber: 37
                }
              })));
              _context0.t0 = expect;
              _context0.next = 4;
              return driver.isDisplayingHeader();
            case 4:
              _context0.t1 = _context0.sent;
              (0, _context0.t0)(_context0.t1).toBeFalsy();
            case 6:
            case "end":
              return _context0.stop();
          }
        }, _callee0);
      })));
      it('should not find a child with id', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee1$(_context1) {
          while (1) switch (_context1.prev = _context1.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 94,
                  columnNumber: 37
                }
              })));
              _context1.t0 = expect;
              _context1.next = 4;
              return driver.hasChildWithId(defaultProps.id);
            case 4:
              _context1.t1 = _context1.sent;
              (0, _context1.t0)(_context1.t1).toBeFalsy();
            case 6:
            case "end":
              return _context1.stop();
          }
        }, _callee1);
      })));

      // There rest of the driver's methods would throw some error
    });
    it('should display something when data is non-empty', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee10$(_context10) {
        while (1) switch (_context10.prev = _context10.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 102,
                columnNumber: 35
              }
            })));
            _context10.t0 = expect;
            _context10.next = 4;
            return driver.isDisplayingNothing();
          case 4:
            _context10.t1 = _context10.sent;
            (0, _context10.t0)(_context10.t1).toBe(false);
          case 6:
          case "end":
            return _context10.stop();
        }
      }, _callee10);
    })));
    it('should display header only when data is empty and showHeaderWhenEmpty is true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
      var props, driver;
      return _regeneratorRuntime.wrap(function _callee11$(_context11) {
        while (1) switch (_context11.prev = _context11.next) {
          case 0:
            props = _objectSpread(_objectSpread({}, defaultProps), {}, {
              data: [],
              showHeaderWhenEmpty: true
            });
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 113,
                columnNumber: 35
              }
            })));
            _context11.t0 = expect;
            _context11.next = 5;
            return driver.isDisplayingHeaderOnly();
          case 5:
            _context11.t1 = _context11.sent;
            (0, _context11.t0)(_context11.t1).toBe(true);
          case 7:
          case "end":
            return _context11.stop();
        }
      }, _callee11);
    })));
    it('should render column titles', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee12$(_context12) {
        while (1) switch (_context12.prev = _context12.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 118,
                columnNumber: 35
              }
            })));
            _context12.t0 = expect;
            _context12.next = 4;
            return driver.getTitles();
          case 4:
            _context12.t1 = _context12.sent;
            (0, _context12.t0)(_context12.t1).toEqual(defaultProps.columns.map(function (col) {
              return col.title;
            }));
          case 6:
          case "end":
            return _context12.stop();
        }
      }, _callee12);
    })));
    describe('column width', function () {
      var columns = [{
        title: 'Row Num',
        width: '30%',
        render: function render(row, rowNum) {
          return rowNum;
        }
      }, {
        title: 'A',
        width: '40px',
        render: function render(row) {
          return row.a;
        }
      }, {
        title: 'B',
        width: '50px',
        render: function render(row) {
          return row.b;
        }
      }];
      it('should apply column.width', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
        var driver, colIndex, column, rowIndex;
        return _regeneratorRuntime.wrap(function _callee13$(_context13) {
          while (1) switch (_context13.prev = _context13.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
                columns: columns,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 133,
                  columnNumber: 11
                }
              })));
              colIndex = 0;
            case 2:
              if (!(colIndex < columns.length)) {
                _context13.next = 26;
                break;
              }
              column = columns[colIndex];
              _context13.t0 = expect;
              _context13.next = 7;
              return driver.getHeaderCellWidth(colIndex);
            case 7:
              _context13.t1 = _context13.sent;
              (0, _context13.t0)(_context13.t1).toEqual(column.width);
              rowIndex = 0;
            case 10:
              _context13.t2 = rowIndex;
              _context13.next = 13;
              return driver.getRowsCount();
            case 13:
              _context13.t3 = _context13.sent;
              if (!(_context13.t2 < _context13.t3)) {
                _context13.next = 23;
                break;
              }
              _context13.t4 = expect;
              _context13.next = 18;
              return driver.getCellWidth(rowIndex, colIndex);
            case 18:
              _context13.t5 = _context13.sent;
              (0, _context13.t4)(_context13.t5).toBe('');
            case 20:
              rowIndex++;
              _context13.next = 10;
              break;
            case 23:
              colIndex++;
              _context13.next = 2;
              break;
            case 26:
            case "end":
              return _context13.stop();
          }
        }, _callee13);
      })));
      it('should apply column.width when header is not in the DOM', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
        var driver, colIndex, column, rowIndex;
        return _regeneratorRuntime.wrap(function _callee14$(_context14) {
          while (1) switch (_context14.prev = _context14.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
                columns: columns,
                hideHeader: true,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 152,
                  columnNumber: 11
                }
              })));
              colIndex = 0;
            case 2:
              if (!(colIndex < columns.length)) {
                _context14.next = 29;
                break;
              }
              column = columns[colIndex];
              rowIndex = 0;
            case 5:
              _context14.t0 = rowIndex;
              _context14.next = 8;
              return driver.getRowsCount();
            case 8:
              _context14.t1 = _context14.sent;
              if (!(_context14.t0 < _context14.t1)) {
                _context14.next = 26;
                break;
              }
              if (!(rowIndex === 0)) {
                _context14.next = 18;
                break;
              }
              _context14.t2 = expect;
              _context14.next = 14;
              return driver.getCellWidth(rowIndex, colIndex);
            case 14:
              _context14.t3 = _context14.sent;
              (0, _context14.t2)(_context14.t3).toEqual(column.width);
              _context14.next = 23;
              break;
            case 18:
              _context14.t4 = expect;
              _context14.next = 21;
              return driver.getCellWidth(rowIndex, colIndex);
            case 21:
              _context14.t5 = _context14.sent;
              (0, _context14.t4)(_context14.t5).toBe('');
            case 23:
              rowIndex++;
              _context14.next = 5;
              break;
            case 26:
              colIndex++;
              _context14.next = 2;
              break;
            case 29:
            case "end":
              return _context14.stop();
          }
        }, _callee14);
      })));
      it('should apply column.width when header is hidden', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
        var driver, colIndex, column, rowIndex;
        return _regeneratorRuntime.wrap(function _callee15$(_context15) {
          while (1) switch (_context15.prev = _context15.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
                columns: columns,
                hideHeaderAccessible: true,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 174,
                  columnNumber: 11
                }
              })));
              colIndex = 0;
            case 2:
              if (!(colIndex < columns.length)) {
                _context15.next = 29;
                break;
              }
              column = columns[colIndex];
              rowIndex = 0;
            case 5:
              _context15.t0 = rowIndex;
              _context15.next = 8;
              return driver.getRowsCount();
            case 8:
              _context15.t1 = _context15.sent;
              if (!(_context15.t0 < _context15.t1)) {
                _context15.next = 26;
                break;
              }
              if (!(rowIndex === 0)) {
                _context15.next = 18;
                break;
              }
              _context15.t2 = expect;
              _context15.next = 14;
              return driver.getCellWidth(rowIndex, colIndex);
            case 14:
              _context15.t3 = _context15.sent;
              (0, _context15.t2)(_context15.t3).toEqual(column.width);
              _context15.next = 23;
              break;
            case 18:
              _context15.t4 = expect;
              _context15.next = 21;
              return driver.getCellWidth(rowIndex, colIndex);
            case 21:
              _context15.t5 = _context15.sent;
              (0, _context15.t4)(_context15.t5).toBe('');
            case 23:
              rowIndex++;
              _context15.next = 5;
              break;
            case 26:
              colIndex++;
              _context15.next = 2;
              break;
            case 29:
            case "end":
              return _context15.stop();
          }
        }, _callee15);
      })));
    });
    it('should display correct amount of rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee16$(_context16) {
        while (1) switch (_context16.prev = _context16.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 200,
                columnNumber: 35
              }
            })));
            _context16.t0 = expect;
            _context16.next = 4;
            return driver.getRowsCount();
          case 4:
            _context16.t1 = _context16.sent;
            (0, _context16.t0)(_context16.t1).toBe(defaultProps.data.length);
          case 6:
          case "end":
            return _context16.stop();
        }
      }, _callee16);
    })));
    it('should render rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee17$(_context17) {
        while (1) switch (_context17.prev = _context17.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 205,
                columnNumber: 35
              }
            })));
            _context17.t0 = expect;
            _context17.next = 4;
            return driver.getRowText(0);
          case 4:
            _context17.t1 = _context17.sent;
            (0, _context17.t0)(_context17.t1).toEqual(['0', 'value 1', 'value 2']);
            _context17.t2 = expect;
            _context17.next = 9;
            return driver.getRowText(1);
          case 9:
            _context17.t3 = _context17.sent;
            (0, _context17.t2)(_context17.t3).toEqual(['1', 'value 3', 'value 4']);
          case 11:
          case "end":
            return _context17.stop();
        }
      }, _callee17);
    })));
    it('should assign class to rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee18$(_context18) {
        while (1) switch (_context18.prev = _context18.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 211,
                columnNumber: 35
              }
            })));
            _context18.t0 = expect;
            _context18.next = 4;
            return driver.getRowsWithClassCount(defaultProps.rowClass);
          case 4:
            _context18.t1 = _context18.sent;
            (0, _context18.t0)(_context18.t1).toBe(defaultProps.data.length);
          case 6:
          case "end":
            return _context18.stop();
        }
      }, _callee18);
    })));
    it('should assign a dynamic class to rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
      var getClass, driver;
      return _regeneratorRuntime.wrap(function _callee19$(_context19) {
        while (1) switch (_context19.prev = _context19.next) {
          case 0:
            getClass = function getClass(rowData) {
              return rowData.a.replace(/[\s]+/g, '-');
            };
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              dynamicRowClass: getClass,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 220,
                columnNumber: 9
              }
            })));
            _context19.t0 = expect;
            _context19.next = 5;
            return driver.getRowsWithClassCount('value-1');
          case 5:
            _context19.t1 = _context19.sent;
            (0, _context19.t0)(_context19.t1).toBe(1);
            _context19.t2 = expect;
            _context19.next = 10;
            return driver.getRowsWithClassCount('value-3');
          case 10:
            _context19.t3 = _context19.sent;
            (0, _context19.t2)(_context19.t3).toBe(1);
            _context19.t4 = expect;
            _context19.next = 15;
            return driver.getRowsWithClassCount(defaultProps.rowClass);
          case 15:
            _context19.t5 = _context19.sent;
            (0, _context19.t4)(_context19.t5).toBe(defaultProps.data.length);
          case 17:
          case "end":
            return _context19.stop();
        }
      }, _callee19);
    })));
    it('should assign dataHook to rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
      var rowDataHook, props, driver;
      return _regeneratorRuntime.wrap(function _callee20$(_context20) {
        while (1) switch (_context20.prev = _context20.next) {
          case 0:
            rowDataHook = 'row-data-hook';
            props = _objectSpread(_objectSpread({}, defaultProps), {}, {
              rowDataHook: rowDataHook
            });
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 232,
                columnNumber: 35
              }
            })));
            _context20.t0 = expect;
            _context20.next = 6;
            return driver.getRowsWithDataHook(rowDataHook);
          case 6:
            _context20.t1 = _context20.sent[0].textContent;
            (0, _context20.t0)(_context20.t1).toBe('0value 1value 2');
            _context20.t2 = expect;
            _context20.next = 11;
            return driver.getRowsWithDataHook(rowDataHook);
          case 11:
            _context20.t3 = _context20.sent[1].textContent;
            (0, _context20.t2)(_context20.t3).toBe('1value 3value 4');
            _context20.t4 = expect;
            _context20.next = 16;
            return driver.getRowsWithDataHook(rowDataHook);
          case 16:
            _context20.t5 = _context20.sent;
            (0, _context20.t4)(_context20.t5).toHaveLength(defaultProps.data.length);
          case 18:
          case "end":
            return _context20.stop();
        }
      }, _callee20);
    })));
    it('should assign a dynamic dataHook to rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
      var calcDataHook, props, driver;
      return _regeneratorRuntime.wrap(function _callee21$(_context21) {
        while (1) switch (_context21.prev = _context21.next) {
          case 0:
            calcDataHook = function calcDataHook(rowData, rowIndex) {
              return "row-index-".concat(rowIndex, "-a-").concat(rowData.a.replace(' ', '_'));
            };
            props = _objectSpread(_objectSpread({}, defaultProps), {}, {
              rowDataHook: calcDataHook
            });
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 248,
                columnNumber: 35
              }
            })));
            _context21.t0 = expect;
            _context21.next = 6;
            return driver.getRowWithDataHook("row-index-0-a-value_1");
          case 6:
            _context21.t1 = _context21.sent.textContent;
            (0, _context21.t0)(_context21.t1).toBe('0value 1value 2');
            _context21.t2 = expect;
            _context21.next = 11;
            return driver.getRowWithDataHook("row-index-1-a-value_3");
          case 11:
            _context21.t3 = _context21.sent.textContent;
            (0, _context21.t2)(_context21.t3).toBe('1value 3value 4');
          case 13:
          case "end":
            return _context21.stop();
        }
      }, _callee21);
    })));
    it('should get a row classes', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
      var getDynamicClass, driver;
      return _regeneratorRuntime.wrap(function _callee22$(_context22) {
        while (1) switch (_context22.prev = _context22.next) {
          case 0:
            getDynamicClass = function getDynamicClass(rowData, rowNum) {
              return rowNum === 1 ? 'rowNum1' : '';
            };
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              dynamicRowClass: getDynamicClass,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 261,
                columnNumber: 9
              }
            })));
            _context22.t0 = expect;
            _context22.next = 5;
            return driver.getRowClasses(1);
          case 5:
            _context22.t1 = _context22.sent.sort();
            (0, _context22.t0)(_context22.t1).toEqual(['class-name', 'rowNum1']);
          case 7:
          case "end":
            return _context22.stop();
        }
      }, _callee22);
    })));
    it('should remove table header from DOM', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee23$(_context23) {
        while (1) switch (_context23.prev = _context23.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              hideHeader: true,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 270,
                columnNumber: 35
              }
            })));
            _context23.t0 = expect;
            _context23.next = 4;
            return driver.isDisplayingHeader();
          case 4:
            _context23.t1 = _context23.sent;
            (0, _context23.t0)(_context23.t1).toBe(false);
          case 6:
          case "end":
            return _context23.stop();
        }
      }, _callee23);
    })));
    it('should hide table header', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee24$(_context24) {
        while (1) switch (_context24.prev = _context24.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              hideHeaderAccessible: true,
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 276,
                columnNumber: 9
              }
            })));
            _context24.t0 = expect;
            _context24.next = 4;
            return driver.isHeaderVisible();
          case 4:
            _context24.t1 = _context24.sent;
            (0, _context24.t0)(_context24.t1).toBe(false);
          case 6:
          case "end":
            return _context24.stop();
        }
      }, _callee24);
    })));
    it('should override default table header styles', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
      var inlineThStyle, driver;
      return _regeneratorRuntime.wrap(function _callee25$(_context25) {
        while (1) switch (_context25.prev = _context25.next) {
          case 0:
            inlineThStyle = {
              thPadding: '1px',
              thHeight: '2px',
              thFontSize: '3px',
              thBorder: '4px',
              thColor: 'rgb(18, 52, 86)',
              thOpacity: '0.8',
              thLetterSpacing: '1.5px'
            };
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, inlineThStyle, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 292,
                columnNumber: 9
              }
            })));
            _context25.t0 = expect;
            _context25.next = 5;
            return driver.getHeaderCellStyle(0);
          case 5:
            _context25.t1 = _context25.sent;
            (0, _context25.t0)(_context25.t1).toEqual(expect.objectContaining({
              padding: '1px',
              height: '2px',
              'font-size': '3px',
              border: '4px',
              color: 'rgb(18, 52, 86)',
              opacity: '0.8',
              'letter-spacing': '1.5px'
            }));
          case 7:
          case "end":
            return _context25.stop();
        }
      }, _callee25);
    })));
    it('should add a class to a table header row', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee26$(_context26) {
        while (1) switch (_context26.prev = _context26.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              headerRowClass: "custom-class",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 309,
                columnNumber: 9
              }
            })));
            _context26.t0 = expect;
            _context26.next = 4;
            return driver.getHeaderRowClasses();
          case 4:
            _context26.t1 = _context26.sent.sort();
            (0, _context26.t0)(_context26.t1).toEqual(['custom-class']);
          case 6:
          case "end":
            return _context26.stop();
        }
      }, _callee26);
    })));
    it('should add a class to a table header', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
      var driver;
      return _regeneratorRuntime.wrap(function _callee27$(_context27) {
        while (1) switch (_context27.prev = _context27.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              headerClass: "custom-class",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 318,
                columnNumber: 9
              }
            })));
            _context27.t0 = expect;
            _context27.next = 4;
            return driver.getHeaderClasses();
          case 4:
            _context27.t1 = _context27.sent.sort();
            (0, _context27.t0)(_context27.t1).toEqual(['custom-class']);
          case 6:
          case "end":
            return _context27.stop();
        }
      }, _callee27);
    })));
    it('should override default cell styles', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
      var clonedProps, driver;
      return _regeneratorRuntime.wrap(function _callee28$(_context28) {
        while (1) switch (_context28.prev = _context28.next) {
          case 0:
            clonedProps = _objectSpread({}, defaultProps);
            clonedProps.columns.push({
              title: 'c',
              render: function render() {
                return 'c';
              },
              style: {
                paddingLeft: '1px',
                height: '2px',
                width: '100px'
              }
            });
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, clonedProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 336,
                columnNumber: 35
              }
            })));
            _context28.t0 = expect;
            _context28.next = 6;
            return driver.getCellStyle(0, 3);
          case 6:
            _context28.t1 = _context28.sent;
            (0, _context28.t0)(_context28.t1).toEqual(expect.objectContaining({
              'padding-left': '1px',
              height: '2px',
              width: '100px'
            }));
          case 8:
          case "end":
            return _context28.stop();
        }
      }, _callee28);
    })));
    it('should override default cell styles using function', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
      var clonedProps, driver;
      return _regeneratorRuntime.wrap(function _callee29$(_context29) {
        while (1) switch (_context29.prev = _context29.next) {
          case 0:
            clonedProps = _objectSpread({}, defaultProps);
            clonedProps.columns.push({
              title: 'c',
              render: function render() {
                return 'c';
              },
              style: function style(_column, _row, rowNum) {
                return {
                  paddingLeft: rowNum + 'px'
                };
              }
            });
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, clonedProps, {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 355,
                columnNumber: 35
              }
            })));
            _context29.t0 = expect;
            _context29.next = 6;
            return driver.getCellStyle(1, 3);
          case 6:
            _context29.t1 = _context29.sent;
            (0, _context29.t0)(_context29.t1).toEqual(expect.objectContaining({
              'padding-left': '1px'
            }));
          case 8:
          case "end":
            return _context29.stop();
        }
      }, _callee29);
    })));
    describe('row keys', function () {
      var createDefaultProps = function createDefaultProps() {
        return {
          id: 'id',
          data: [{
            a: 'value 1',
            b: 'value 2'
          }, {
            a: 'value 3',
            b: 'value 4'
          }],
          columns: [{
            title: 'Row Num',
            render: function render(row, rowNum) {
              return rowNum;
            }
          }, {
            title: 'A',
            render: function render(row) {
              return row.a;
            }
          }, {
            title: 'B',
            render: function render(row) {
              return row.b;
            }
          }],
          rowClass: 'class-name'
        };
      };
      it('should assign data.id as row keys', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
        var props, _render, container, getAllByRole, key0, key1;
        return _regeneratorRuntime.wrap(function _callee30$(_context30) {
          while (1) switch (_context30.prev = _context30.next) {
            case 0:
              props = createDefaultProps();
              props.data[0].id = '000';
              props.data[1].id = '111';
              _render = render(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 383,
                  columnNumber: 52
                }
              }))), container = _render.container, getAllByRole = _render.getAllByRole;
              key0 = container.querySelectorAll('[data-table-row="dataTableRow"]')[0].getAttribute('data-key');
              expect(key0).toBe('000');
              key1 = container.querySelectorAll('[ data-table-row="dataTableRow"]')[1].getAttribute('data-key');
              expect(key1).toBe('111');
            case 8:
            case "end":
              return _context30.stop();
          }
        }, _callee30);
      })));
      it('should use rowIndex as keys', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
        var _render2, container, key0, key1;
        return _regeneratorRuntime.wrap(function _callee31$(_context31) {
          while (1) switch (_context31.prev = _context31.next) {
            case 0:
              _render2 = render(/*#__PURE__*/React.createElement(DataTable, _extends({}, createDefaultProps(), {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 399,
                  columnNumber: 38
                }
              }))), container = _render2.container;
              key0 = container.querySelectorAll('[data-table-row="dataTableRow"]')[0].getAttribute('data-key');
              expect(key0).toBe('0');
              key1 = container.querySelectorAll('[ data-table-row="dataTableRow"]')[1].getAttribute('data-key');
              expect(key1).toBe('1');
            case 5:
            case "end":
              return _context31.stop();
          }
        }, _callee31);
      })));
    });
    it('should use rowIndex as data-index', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
      var _render3, container, rows, i;
      return _regeneratorRuntime.wrap(function _callee32$(_context32) {
        while (1) switch (_context32.prev = _context32.next) {
          case 0:
            _render3 = render(/*#__PURE__*/React.createElement(DataTable, _extends({}, createDefaultProps(), {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 416,
                columnNumber: 36
              }
            }))), container = _render3.container;
            rows = container.querySelectorAll('[data-table-row="dataTableRow"]');
            for (i = 0; i < rows.length; i++) {
              expect(rows[i].getAttribute('data-index')).toBe("index-".concat(i));
            }
          case 3:
          case "end":
            return _context32.stop();
        }
      }, _callee32);
    })));
    describe('clickableDataRow class', function () {
      it('should not assign the class to rows by default', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee33$(_context33) {
          while (1) switch (_context33.prev = _context33.next) {
            case 0:
              props = _objectSpread({}, defaultProps);
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 431,
                  columnNumber: 37
                }
              })));
              _context33.t0 = expect;
              _context33.next = 5;
              return driver.isRowClickable(0);
            case 5:
              _context33.t1 = _context33.sent;
              (0, _context33.t0)(_context33.t1).toBe(false);
            case 7:
            case "end":
              return _context33.stop();
          }
        }, _callee33);
      })));
      it('should assign the class to rows when onRowClick prop is provided', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee34$(_context34) {
          while (1) switch (_context34.prev = _context34.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 442,
                  columnNumber: 37
                }
              })));
              _context34.t0 = expect;
              _context34.next = 5;
              return driver.isRowClickable(0);
            case 5:
              _context34.t1 = _context34.sent;
              (0, _context34.t0)(_context34.t1).toBe(true);
            case 7:
            case "end":
              return _context34.stop();
          }
        }, _callee34);
      })));
      it('should not assign the class to rows when isRowDisabled returns true', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee35$(_context35) {
          while (1) switch (_context35.prev = _context35.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn(),
                isRowDisabled: function isRowDisabled() {
                  return true;
                }
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 453,
                  columnNumber: 37
                }
              })));
              _context35.t0 = expect;
              _context35.next = 5;
              return driver.isRowClickable(0);
            case 5:
              _context35.t1 = _context35.sent;
              (0, _context35.t0)(_context35.t1).toBe(false);
            case 7:
            case "end":
              return _context35.stop();
          }
        }, _callee35);
      })));
    });
    describe('animatedDataRow class', function () {
      it('should not assign the class to rows by default', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee36$(_context36) {
          while (1) switch (_context36.prev = _context36.next) {
            case 0:
              props = _objectSpread({}, defaultProps);
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 462,
                  columnNumber: 37
                }
              })));
              _context36.t0 = expect;
              _context36.next = 5;
              return driver.isRowAnimated(0);
            case 5:
              _context36.t1 = _context36.sent;
              (0, _context36.t0)(_context36.t1).toBe(false);
            case 7:
            case "end":
              return _context36.stop();
          }
        }, _callee36);
      })));
      it('should assign the class to rows when rowDetails prop is provided', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee37() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee37$(_context37) {
          while (1) switch (_context37.prev = _context37.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                rowDetails: function rowDetails(row) {
                  return /*#__PURE__*/React.createElement("span", {
                    __self: _this,
                    __source: {
                      fileName: _jsxFileName,
                      lineNumber: 470,
                      columnNumber: 30
                    }
                  }, row.a);
                }
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 473,
                  columnNumber: 37
                }
              })));
              _context37.t0 = expect;
              _context37.next = 5;
              return driver.isRowAnimated(0);
            case 5:
              _context37.t1 = _context37.sent;
              (0, _context37.t0)(_context37.t1).toBe(true);
            case 7:
            case "end":
              return _context37.stop();
          }
        }, _callee37);
      })));
    });
    describe('isRowHighlighted', function () {
      it('should return true only for highligthed rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee38() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee38$(_context38) {
          while (1) switch (_context38.prev = _context38.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn(),
                isRowHighlight: function isRowHighlight(row) {
                  return row === defaultProps.data[0];
                }
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 486,
                  columnNumber: 37
                }
              })));
              _context38.t0 = expect;
              _context38.next = 5;
              return driver.isRowHighlighted(0);
            case 5:
              _context38.t1 = _context38.sent;
              (0, _context38.t0)(_context38.t1).toBe(true);
              _context38.t2 = expect;
              _context38.next = 10;
              return driver.isRowHighlighted(1);
            case 10:
              _context38.t3 = _context38.sent;
              (0, _context38.t2)(_context38.t3).toBe(false);
            case 12:
            case "end":
              return _context38.stop();
          }
        }, _callee38);
      })));
    });
    describe('Row event handlers', function () {
      var tests = [{
        handler: 'onRowClick',
        driverMethod: 'clickRow'
      }, {
        handler: 'onMouseEnterRow',
        driverMethod: 'mouseEnterRow'
      }, {
        handler: 'onMouseLeaveRow',
        driverMethod: 'mouseLeaveRow'
      }];
      tests.forEach(function (_ref39) {
        var handler = _ref39.handler,
          driverMethod = _ref39.driverMethod;
        it("should call ".concat(handler, " with row data and index"), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee39() {
          var props, driver;
          return _regeneratorRuntime.wrap(function _callee39$(_context39) {
            while (1) switch (_context39.prev = _context39.next) {
              case 0:
                props = _objectSpread(_objectSpread({}, defaultProps), {}, _defineProperty({}, handler, vi.fn()));
                driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 507,
                    columnNumber: 39
                  }
                })));
                _context39.next = 4;
                return driver[driverMethod](0);
              case 4:
                expect(props[handler]).toHaveBeenCalledWith(props.data[0], 0);
                _context39.next = 7;
                return driver[driverMethod](1);
              case 7:
                waitFor(function () {
                  expect(props[handler]).toHaveBeenLastCalledWith(props.data[1], 1);
                });
              case 8:
              case "end":
                return _context39.stop();
            }
          }, _callee39);
        })));
      });
      it("should not call onRowClick if row is disabled", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee40() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee40$(_context40) {
          while (1) switch (_context40.prev = _context40.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn(),
                isRowDisabled: function isRowDisabled(row) {
                  return row === defaultProps.data[0];
                }
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 527,
                  columnNumber: 37
                }
              })));
              _context40.next = 4;
              return driver.clickRow(0);
            case 4:
              expect(props.onRowClick).not.toHaveBeenCalledWith(props.data[0], 0);
              _context40.next = 7;
              return driver.clickRow(1);
            case 7:
              expect(props.onRowClick).toHaveBeenCalledWith(props.data[1], 1);
            case 8:
            case "end":
              return _context40.stop();
          }
        }, _callee40);
      })));
      it('should expand with correct content and collapse', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee41() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee41$(_context41) {
          while (1) switch (_context41.prev = _context41.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                rowDetails: function rowDetails(row) {
                  return /*#__PURE__*/React.createElement("span", {
                    __self: _this,
                    __source: {
                      fileName: _jsxFileName,
                      lineNumber: 539,
                      columnNumber: 30
                    }
                  }, row.a);
                }
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 542,
                  columnNumber: 37
                }
              })));
              _context41.t0 = expect;
              _context41.next = 5;
              return driver.hasRowDetails(0);
            case 5:
              _context41.t1 = _context41.sent;
              (0, _context41.t0)(_context41.t1).toBe(true);
              _context41.t2 = expect;
              _context41.next = 10;
              return driver.getRowDetailsText(0);
            case 10:
              _context41.t3 = _context41.sent;
              (0, _context41.t2)(_context41.t3).toBe('');
              _context41.next = 14;
              return driver.clickRow(0);
            case 14:
              _context41.t4 = expect;
              _context41.next = 17;
              return driver.getRowDetailsText(0);
            case 17:
              _context41.t5 = _context41.sent;
              (0, _context41.t4)(_context41.t5).toBe(defaultProps.data[0].a);
              _context41.next = 21;
              return driver.clickRow(0);
            case 21:
              _context41.t6 = expect;
              _context41.next = 24;
              return driver.hasRowDetails(0);
            case 24:
              _context41.t7 = _context41.sent;
              (0, _context41.t6)(_context41.t7).toBe(true);
              _context41.t8 = expect;
              _context41.next = 29;
              return driver.getRowDetailsText(0);
            case 29:
              _context41.t9 = _context41.sent;
              (0, _context41.t8)(_context41.t9).toBe('');
            case 31:
            case "end":
              return _context41.stop();
          }
        }, _callee41);
      })));
      it('should position rowDetails correctly when adding rows to the top of the table', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
        var props, _render4, driver, rerender;
        return _regeneratorRuntime.wrap(function _callee42$(_context42) {
          while (1) switch (_context42.prev = _context42.next) {
            case 0:
              props = {
                data: [{
                  a: 'foo',
                  b: 'bar'
                }],
                columns: [{
                  title: 'Row Num',
                  render: function render(row, rowNum) {
                    return rowNum;
                  }
                }, {
                  title: 'A',
                  render: function render(row) {
                    return row.a;
                  }
                }, {
                  title: 'B',
                  render: function render(row) {
                    return row.b;
                  }
                }],
                rowDetails: function rowDetails(row) {
                  return row.a;
                }
              };
              _render4 = render(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 564,
                  columnNumber: 45
                }
              }))), driver = _render4.driver, rerender = _render4.rerender;
              _context42.t0 = expect;
              _context42.next = 5;
              return driver.getRowDetailsText(0);
            case 5:
              _context42.t1 = _context42.sent;
              (0, _context42.t0)(_context42.t1).toBe('');
              _context42.next = 9;
              return driver.clickRow(0);
            case 9:
              _context42.t2 = expect;
              _context42.next = 12;
              return driver.getRowDetailsText(0);
            case 12:
              _context42.t3 = _context42.sent;
              (0, _context42.t2)(_context42.t3).toBe('foo');
              rerender(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                data: [{
                  a: 'value 5',
                  b: 'value 6'
                }].concat(_toConsumableArray(props.data)),
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 571,
                  columnNumber: 11
                }
              })));
              _context42.t4 = expect;
              _context42.next = 18;
              return driver.getRowDetailsText(0);
            case 18:
              _context42.t5 = _context42.sent;
              (0, _context42.t4)(_context42.t5).toBe('');
              _context42.t6 = expect;
              _context42.next = 23;
              return driver.getRowDetailsText(1);
            case 23:
              _context42.t7 = _context42.sent;
              (0, _context42.t6)(_context42.t7).toBe('foo');
            case 25:
            case "end":
              return _context42.stop();
          }
        }, _callee42);
      })));
      it('should have correct row count when row details enabled', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee43$(_context43) {
          while (1) switch (_context43.prev = _context43.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                rowDetails: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 589,
                  columnNumber: 37
                }
              })));
              _context43.t0 = expect;
              _context43.next = 5;
              return driver.getRowsCount();
            case 5:
              _context43.t1 = _context43.sent;
              (0, _context43.t0)(_context43.t1).toBe(2);
              _context43.next = 9;
              return driver.clickRow(0);
            case 9:
              _context43.t2 = expect;
              _context43.next = 12;
              return driver.getRowsCount();
            case 12:
              _context43.t3 = _context43.sent;
              (0, _context43.t2)(_context43.t3).toBe(2);
            case 14:
            case "end":
              return _context43.stop();
          }
        }, _callee43);
      })));
    });
    describe('onCellClick', function () {
      it("should call onCellClick with column data, row data and index", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
        var columnClickHandler, props, driver;
        return _regeneratorRuntime.wrap(function _callee44$(_context44) {
          while (1) switch (_context44.prev = _context44.next) {
            case 0:
              columnClickHandler = vi.fn();
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                columns: [{
                  title: 'Row Num',
                  render: function render(row, rowNum) {
                    return rowNum;
                  },
                  onCellClick: columnClickHandler
                }, {
                  title: 'A',
                  render: function render(row) {
                    return row.a;
                  }
                }]
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 611,
                  columnNumber: 37
                }
              })));
              _context44.next = 5;
              return driver.clickColumn(0, 0);
            case 5:
              expect(columnClickHandler).toHaveBeenCalledWith(props.columns[0], props.data[0], 0, expect.anything());
              columnClickHandler.mockReset();
              _context44.next = 9;
              return driver.clickColumn(0, 1);
            case 9:
              expect(columnClickHandler).not.toHaveBeenCalled();
            case 10:
            case "end":
              return _context44.stop();
          }
        }, _callee44);
      })));
    });
    describe('Sortable column titles', function () {
      var props;
      beforeEach(function () {
        props = _objectSpread(_objectSpread({}, defaultProps), {}, {
          columns: [{
            title: 'Row Num',
            render: function render(row, rowNum) {
              return rowNum;
            }
          }, {
            title: 'A',
            sortable: true,
            sortDescending: false,
            render: function render(row) {
              return row.a;
            }
          }, {
            title: 'B',
            render: function render(row) {
              return row.b;
            }
          }, {
            title: 'C',
            sortable: true,
            sortDescending: true,
            render: function render(row) {
              return row.a;
            }
          }]
        });
      });
      it('should display sortable title', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
        var _props, driver;
        return _regeneratorRuntime.wrap(function _callee45$(_context45) {
          while (1) switch (_context45.prev = _context45.next) {
            case 0:
              _props = _objectSpread(_objectSpread({}, props), {}, {
                onSortClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, _props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 653,
                  columnNumber: 37
                }
              })));
              _context45.t0 = expect;
              _context45.next = 5;
              return driver.hasSortableTitle(0);
            case 5:
              _context45.t1 = _context45.sent;
              (0, _context45.t0)(_context45.t1).toBe(false);
              _context45.t2 = expect;
              _context45.next = 10;
              return driver.hasSortableTitle(1);
            case 10:
              _context45.t3 = _context45.sent;
              (0, _context45.t2)(_context45.t3).toBe(true);
            case 12:
            case "end":
              return _context45.stop();
          }
        }, _callee45);
      })));
      it('should display sort asc/desc style', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee46() {
        var _props, driver;
        return _regeneratorRuntime.wrap(function _callee46$(_context46) {
          while (1) switch (_context46.prev = _context46.next) {
            case 0:
              _props = _objectSpread(_objectSpread({}, props), {}, {
                onSortClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, _props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 660,
                  columnNumber: 37
                }
              })));
              _context46.t0 = expect;
              _context46.next = 5;
              return driver.hasSortDescending(1);
            case 5:
              _context46.t1 = _context46.sent;
              (0, _context46.t0)(_context46.t1).toBe(false);
              _context46.t2 = expect;
              _context46.next = 10;
              return driver.hasSortDescending(3);
            case 10:
              _context46.t3 = _context46.sent;
              (0, _context46.t2)(_context46.t3).toBe(true);
            case 12:
            case "end":
              return _context46.stop();
          }
        }, _callee46);
      })));
      it('should call on sort callback', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee47() {
        var _props, driver;
        return _regeneratorRuntime.wrap(function _callee47$(_context47) {
          while (1) switch (_context47.prev = _context47.next) {
            case 0:
              _props = _objectSpread(_objectSpread({}, props), {}, {
                onSortClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, _props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 667,
                  columnNumber: 37
                }
              })));
              _context47.next = 4;
              return driver.clickSort(1);
            case 4:
              expect(_props.onSortClick).toHaveBeenCalledWith(props.columns[1], 1);
            case 5:
            case "end":
              return _context47.stop();
          }
        }, _callee47);
      })));
      it('should not call on sort callback when non-sortable column is clicked', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee48() {
        var _props, driver;
        return _regeneratorRuntime.wrap(function _callee48$(_context48) {
          while (1) switch (_context48.prev = _context48.next) {
            case 0:
              _props = _objectSpread(_objectSpread({}, props), {}, {
                onSortClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, _props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 674,
                  columnNumber: 37
                }
              })));
              _context48.next = 4;
              return driver.clickSort(2);
            case 4:
              expect(_props.onSortClick).not.toHaveBeenCalled();
            case 5:
            case "end":
              return _context48.stop();
          }
        }, _callee48);
      })));
    });
    describe('Tooltip titles', function () {
      it('should display tooltip icon', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee49() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee49$(_context49) {
          while (1) switch (_context49.prev = _context49.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                columns: [{
                  title: 'Row Num',
                  render: function render(row, rowNum) {
                    return rowNum;
                  }
                }, {
                  title: 'A',
                  infoTooltipProps: {
                    content: 'Vary informative tooltip text',
                    children: false
                  },
                  render: function render(row) {
                    return row.a;
                  }
                }, {
                  title: 'B',
                  render: function render(row) {
                    return row.b;
                  }
                }]
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 697,
                  columnNumber: 37
                }
              })));
              _context49.t0 = expect;
              _context49.next = 5;
              return driver.hasInfoIcon(0);
            case 5:
              _context49.t1 = _context49.sent;
              (0, _context49.t0)(_context49.t1).toBe(false);
              _context49.t2 = expect;
              _context49.next = 10;
              return driver.hasInfoIcon(1);
            case 10:
              _context49.t3 = _context49.sent;
              (0, _context49.t2)(_context49.t3).toBe(true);
            case 12:
            case "end":
              return _context49.stop();
          }
        }, _callee49);
      })));
    });
    describe('titleSuffix', function () {
      it('should render titleSuffix when provided', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee50() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee50$(_context50) {
          while (1) switch (_context50.prev = _context50.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                columns: [{
                  title: 'Row Num',
                  render: function render(row, rowNum) {
                    return rowNum;
                  }
                }, {
                  title: 'A',
                  titleSuffix: /*#__PURE__*/React.createElement("span", {
                    "data-hook": "custom-suffix",
                    __self: _this,
                    __source: {
                      fileName: _jsxFileName,
                      lineNumber: 711,
                      columnNumber: 28
                    }
                  }, "action"),
                  render: function render(row) {
                    return row.a;
                  }
                }, {
                  title: 'B',
                  render: function render(row) {
                    return row.b;
                  }
                }]
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 717,
                  columnNumber: 37
                }
              })));
              _context50.t0 = expect;
              _context50.next = 5;
              return driver.hasTitleSuffix(0);
            case 5:
              _context50.t1 = _context50.sent;
              (0, _context50.t0)(_context50.t1).toBe(false);
              _context50.t2 = expect;
              _context50.next = 10;
              return driver.hasTitleSuffix(1);
            case 10:
              _context50.t3 = _context50.sent;
              (0, _context50.t2)(_context50.t3).toBe(true);
              _context50.t4 = expect;
              _context50.next = 15;
              return driver.hasTitleSuffix(2);
            case 15:
              _context50.t5 = _context50.sent;
              (0, _context50.t4)(_context50.t5).toBe(false);
            case 17:
            case "end":
              return _context50.stop();
          }
        }, _callee50);
      })));
      it('should not render titleSuffix when not provided', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee51() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee51$(_context51) {
          while (1) switch (_context51.prev = _context51.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 724,
                  columnNumber: 37
                }
              })));
              _context51.t0 = expect;
              _context51.next = 4;
              return driver.hasTitleSuffix(0);
            case 4:
              _context51.t1 = _context51.sent;
              (0, _context51.t0)(_context51.t1).toBe(false);
            case 6:
            case "end":
              return _context51.stop();
          }
        }, _callee51);
      })));
      it('should not render titleSuffix for falsy values (false, null)', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee52() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee52$(_context52) {
          while (1) switch (_context52.prev = _context52.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                columns: [{
                  title: 'A',
                  titleSuffix: false,
                  sortable: true,
                  sortDescending: false,
                  render: function render(row) {
                    return row.a;
                  }
                }, {
                  title: 'B',
                  titleSuffix: null,
                  sortable: true,
                  sortDescending: false,
                  render: function render(row) {
                    return row.b;
                  }
                }]
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 748,
                  columnNumber: 37
                }
              })));
              _context52.t0 = expect;
              _context52.next = 5;
              return driver.hasTitleSuffix(0);
            case 5:
              _context52.t1 = _context52.sent;
              (0, _context52.t0)(_context52.t1).toBe(false);
              _context52.t2 = expect;
              _context52.next = 10;
              return driver.hasTitleSuffix(1);
            case 10:
              _context52.t3 = _context52.sent;
              (0, _context52.t2)(_context52.t3).toBe(false);
            case 12:
            case "end":
              return _context52.stop();
          }
        }, _callee52);
      })));
      it('should not trigger sort when clicking titleSuffix on a sortable column', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee53() {
        var onSortClick, props, driver;
        return _regeneratorRuntime.wrap(function _callee53$(_context53) {
          while (1) switch (_context53.prev = _context53.next) {
            case 0:
              onSortClick = vi.fn();
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onSortClick: onSortClick,
                columns: [{
                  title: 'A',
                  titleSuffix: /*#__PURE__*/React.createElement("button", {
                    "data-hook": "custom-suffix",
                    __self: _this,
                    __source: {
                      fileName: _jsxFileName,
                      lineNumber: 761,
                      columnNumber: 28
                    }
                  }, "action"),
                  sortable: true,
                  sortDescending: false,
                  render: function render(row) {
                    return row.a;
                  }
                }]
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 768,
                  columnNumber: 37
                }
              })));
              _context53.next = 5;
              return driver.clickTitleSuffix(0);
            case 5:
              expect(onSortClick).not.toHaveBeenCalled();
            case 6:
            case "end":
              return _context53.stop();
          }
        }, _callee53);
      })));
      it('should not trigger sort when pressing Enter/Space on titleSuffix', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee54() {
        var onSortClick, props, driver;
        return _regeneratorRuntime.wrap(function _callee54$(_context54) {
          while (1) switch (_context54.prev = _context54.next) {
            case 0:
              onSortClick = vi.fn();
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onSortClick: onSortClick,
                columns: [{
                  title: 'A',
                  titleSuffix: /*#__PURE__*/React.createElement("button", {
                    "data-hook": "custom-suffix",
                    __self: _this,
                    __source: {
                      fileName: _jsxFileName,
                      lineNumber: 781,
                      columnNumber: 28
                    }
                  }, "action"),
                  sortable: true,
                  sortDescending: false,
                  render: function render(row) {
                    return row.a;
                  }
                }]
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 788,
                  columnNumber: 37
                }
              })));
              _context54.next = 5;
              return driver.pressKeyOnTitleSuffix(0, 'Enter');
            case 5:
              expect(onSortClick).not.toHaveBeenCalled();
              _context54.next = 8;
              return driver.pressKeyOnTitleSuffix(0, ' ');
            case 8:
              expect(onSortClick).not.toHaveBeenCalled();
            case 9:
            case "end":
              return _context54.stop();
          }
        }, _callee54);
      })));
    });
    describe('Virtualization', function () {
      it('should render a small portion of the lines', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee55() {
        var tableProps, props, driver;
        return _regeneratorRuntime.wrap(function _callee55$(_context55) {
          while (1) switch (_context55.prev = _context55.next) {
            case 0:
              tableProps = createDefaultProps();
              tableProps.data = _toConsumableArray(Array(14)).map(function (_n, i) {
                return {
                  id: i,
                  a: "value a ".concat(i),
                  b: "value b ".concat(i)
                };
              });
              props = _objectSpread(_objectSpread({}, tableProps), {}, {
                virtualized: true,
                virtualizedTableHeight: 350,
                virtualizedLineHeight: 60
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 810,
                  columnNumber: 37
                }
              }))); // 5 items can fit in fully.
              // 1 item appear only partially
              // 2 items are for better scrolling reasons
              _context55.t0 = expect;
              _context55.next = 7;
              return driver.getRowsCount();
            case 7:
              _context55.t1 = _context55.sent;
              (0, _context55.t0)(_context55.t1).toBe(8);
            case 9:
            case "end":
              return _context55.stop();
          }
        }, _callee55);
      })));
    });
    it('should highlight even rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee56() {
      var driver, classes;
      return _regeneratorRuntime.wrap(function _callee56$(_context56) {
        while (1) switch (_context56.prev = _context56.next) {
          case 0:
            driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
              isRowHighlight: function isRowHighlight(_, rowNum) {
                return rowNum % 2 === 0;
              },
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 820,
                columnNumber: 9
              }
            })));
            _context56.next = 3;
            return driver.getRowClasses(0);
          case 3:
            classes = _context56.sent.sort();
            expect(classes[0]).toContain('highlight');
          case 5:
          case "end":
            return _context56.stop();
        }
      }, _callee56);
    })));
    describe('masking provider', function () {
      it('should mask text in data cells [when] component is wrapped with WixStyleReactMaskingProvider', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee57() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee57$(_context57) {
          while (1) switch (_context57.prev = _context57.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(WixStyleReactMaskingProvider, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 833,
                  columnNumber: 11
                }
              }, /*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 834,
                  columnNumber: 13
                }
              }))));
              _context57.t0 = expect;
              _context57.next = 4;
              return driver.isCellMasked(0, 0);
            case 4:
              _context57.t1 = _context57.sent;
              (0, _context57.t0)(_context57.t1).toBe(true);
              _context57.t2 = expect;
              _context57.next = 9;
              return driver.isCellMasked(1, 1);
            case 9:
              _context57.t3 = _context57.sent;
              (0, _context57.t2)(_context57.t3).toBe(true);
            case 11:
            case "end":
              return _context57.stop();
          }
        }, _callee57);
      })));
    });
    describe('keyboard navigation', function () {
      it('should add tabIndex=0 to clickable rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee58() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee58$(_context58) {
          while (1) switch (_context58.prev = _context58.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 850,
                  columnNumber: 37
                }
              })));
              _context58.t0 = expect;
              _context58.next = 5;
              return driver.getRowTabIndex(0);
            case 5:
              _context58.t1 = _context58.sent;
              (0, _context58.t0)(_context58.t1).toBe(0);
              _context58.t2 = expect;
              _context58.next = 10;
              return driver.getRowTabIndex(1);
            case 10:
              _context58.t3 = _context58.sent;
              (0, _context58.t2)(_context58.t3).toBe(0);
            case 12:
            case "end":
              return _context58.stop();
          }
        }, _callee58);
      })));
      it('should not add tabIndex to non-clickable rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee59() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee59$(_context59) {
          while (1) switch (_context59.prev = _context59.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, defaultProps, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 856,
                  columnNumber: 37
                }
              })));
              _context59.t0 = expect;
              _context59.next = 4;
              return driver.getRowTabIndex(0);
            case 4:
              _context59.t1 = _context59.sent;
              (0, _context59.t0)(_context59.t1).toBe(-1);
            case 6:
            case "end":
              return _context59.stop();
          }
        }, _callee59);
      })));
      it('should not add tabIndex to disabled rows', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee60() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee60$(_context60) {
          while (1) switch (_context60.prev = _context60.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn(),
                isRowDisabled: function isRowDisabled() {
                  return true;
                }
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 867,
                  columnNumber: 37
                }
              })));
              _context60.t0 = expect;
              _context60.next = 5;
              return driver.getRowTabIndex(0);
            case 5:
              _context60.t1 = _context60.sent;
              (0, _context60.t0)(_context60.t1).toBe(-1);
            case 7:
            case "end":
              return _context60.stop();
          }
        }, _callee60);
      })));
      it('should trigger onRowClick when Enter key is pressed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee61() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee61$(_context61) {
          while (1) switch (_context61.prev = _context61.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 877,
                  columnNumber: 37
                }
              })));
              _context61.next = 4;
              return driver.pressKeyOnRow(0, 'Enter');
            case 4:
              expect(props.onRowClick).toHaveBeenCalledWith(props.data[0], 0);
            case 5:
            case "end":
              return _context61.stop();
          }
        }, _callee61);
      })));
      it('should trigger onRowClick when Space key is pressed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee62() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee62$(_context62) {
          while (1) switch (_context62.prev = _context62.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 888,
                  columnNumber: 37
                }
              })));
              _context62.next = 4;
              return driver.pressKeyOnRow(0, ' ');
            case 4:
              expect(props.onRowClick).toHaveBeenCalledWith(props.data[0], 0);
            case 5:
            case "end":
              return _context62.stop();
          }
        }, _callee62);
      })));
      it('should not trigger onRowClick when other keys are pressed', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee63() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee63$(_context63) {
          while (1) switch (_context63.prev = _context63.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn()
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 899,
                  columnNumber: 37
                }
              })));
              _context63.next = 4;
              return driver.pressKeyOnRow(0, 'a');
            case 4:
              expect(props.onRowClick).not.toHaveBeenCalled();
            case 5:
            case "end":
              return _context63.stop();
          }
        }, _callee63);
      })));
      it('should not trigger onRowClick on keyboard press if row is disabled', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee64() {
        var props, driver;
        return _regeneratorRuntime.wrap(function _callee64$(_context64) {
          while (1) switch (_context64.prev = _context64.next) {
            case 0:
              props = _objectSpread(_objectSpread({}, defaultProps), {}, {
                onRowClick: vi.fn(),
                isRowDisabled: function isRowDisabled(row) {
                  return row === defaultProps.data[0];
                }
              });
              driver = createDriver(/*#__PURE__*/React.createElement(DataTable, _extends({}, props, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 911,
                  columnNumber: 37
                }
              })));
              _context64.next = 4;
              return driver.pressKeyOnRow(0, 'Enter');
            case 4:
              expect(props.onRowClick).not.toHaveBeenCalledWith(props.data[0], 0);
              _context64.next = 7;
              return driver.pressKeyOnRow(1, 'Enter');
            case 7:
              expect(props.onRowClick).toHaveBeenCalledWith(props.data[1], 1);
            case 8:
            case "end":
              return _context64.stop();
          }
        }, _callee64);
      })));
    });
  }
});