"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireWildcard(require("react"));
var _unit = require("../../utils/test-utils/unit");
var _constants = require("../../SidebarNext/constants");
var _SidebarNextContext = require("../../SidebarNext/SidebarNextContext");
var _SidebarItemNext = _interopRequireDefault(require("../SidebarItemNext"));
var _SidebarItemNextPrivateUni = require("./SidebarItemNext.private.uni.driver");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/SidebarItemNext/test/SidebarItemNext.spec.jsx",
  _this = void 0;
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
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) { (0, _defineProperty2["default"])(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; }
var SidebarNextContextOverride = function SidebarNextContextOverride(_ref) {
  var context = _ref.context,
    children = _ref.children;
  var baseContext = (0, _react.useContext)(_SidebarNextContext.SidebarNextContext);
  var contextWithOverride = (0, _react.useMemo)(function () {
    return _objectSpread(_objectSpread({}, baseContext), context);
  }, [baseContext, context]);
  return /*#__PURE__*/_react["default"].createElement(_SidebarNextContext.SidebarNextContext.Provider, {
    value: contextWithOverride,
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 20,
      columnNumber: 5
    }
  }, children);
};
var renderWithContext = function renderWithContext(content, context) {
  return (0, _unit.createRendererWithUniDriver)(_SidebarItemNextPrivateUni.sidebarItemNextPrivateDriverFactory, {
    wrapper: function wrapper(_ref2) {
      var children = _ref2.children;
      return /*#__PURE__*/_react["default"].createElement(SidebarNextContextOverride, {
        context: context,
        __self: _this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 29,
          columnNumber: 7
        }
      }, children);
    }
  })(content);
};

// TODO: accessibility: aria-hidden within popover, only focusable within accordion
// TODO: accessibility: aria-current="page" when selected and within accordion
// TODO: accessibility: aria-level

describe('SidebarItemNext', function () {
  describe('properties', function () {
    describe('prefix', function () {
      it('should render prefix when provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
        var _renderWithContext, driver;
        return _regenerator["default"].wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _renderWithContext = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                prefix: /*#__PURE__*/_react["default"].createElement("div", {
                  "data-hook": "prefix-item",
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 44,
                    columnNumber: 36
                  }
                }),
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 44,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext.driver;
              _context.t0 = expect;
              _context.next = 4;
              return driver.prefixExists();
            case 4:
              _context.t1 = _context.sent;
              (0, _context.t0)(_context.t1).toBe(true);
            case 6:
            case "end":
              return _context.stop();
          }
        }, _callee);
      })));
    });
    describe('suffix', function () {
      it('should render suffix when provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
        var _renderWithContext2, driver;
        return _regenerator["default"].wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _renderWithContext2 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                suffix: /*#__PURE__*/_react["default"].createElement("div", {
                  "data-hook": "suffix-item",
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 56,
                    columnNumber: 36
                  }
                }),
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 56,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext2.driver;
              _context2.t0 = expect;
              _context2.next = 4;
              return driver.getSuffixCount();
            case 4:
              _context2.t1 = _context2.sent;
              (0, _context2.t0)(_context2.t1).toBe(1);
              _context2.t2 = expect;
              _context2.next = 9;
              return driver.suffixExists();
            case 9:
              _context2.t3 = _context2.sent;
              (0, _context2.t2)(_context2.t3).toBe(true);
            case 11:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      })));
      it('should not render suffix if disabled', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
        var _renderWithContext3, driver;
        return _regenerator["default"].wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              _renderWithContext3 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                suffix: /*#__PURE__*/_react["default"].createElement("div", {
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 67,
                    columnNumber: 36
                  }
                }),
                disabled: true,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 67,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext3.driver;
              _context3.t0 = expect;
              _context3.next = 4;
              return driver.suffixExists();
            case 4:
              _context3.t1 = _context3.sent;
              (0, _context3.t0)(_context3.t1).toBe(false);
            case 6:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      })));
      it('should render multiple suffixes when provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
        var _renderWithContext4, driver;
        return _regenerator["default"].wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              _renderWithContext4 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                suffix: [/*#__PURE__*/_react["default"].createElement("div", {
                  key: "suffix1",
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 78,
                    columnNumber: 22
                  }
                }), /*#__PURE__*/_react["default"].createElement("div", {
                  key: "suffix2",
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 78,
                    columnNumber: 45
                  }
                })],
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 77,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext4.driver;
              _context4.t0 = expect;
              _context4.next = 4;
              return driver.getSuffixCount();
            case 4:
              _context4.t1 = _context4.sent;
              (0, _context4.t0)(_context4.t1).toBe(2);
            case 6:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      })));
      it('should render maximum 2 suffixes', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
        var _renderWithContext5, driver;
        return _regenerator["default"].wrap(function _callee5$(_context5) {
          while (1) switch (_context5.prev = _context5.next) {
            case 0:
              _renderWithContext5 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                suffix: [/*#__PURE__*/_react["default"].createElement("div", {
                  key: "suffix1",
                  "data-hook": "suffix1",
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 91,
                    columnNumber: 15
                  }
                }), /*#__PURE__*/_react["default"].createElement("div", {
                  key: "suffix2",
                  "data-hook": "suffix2",
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 92,
                    columnNumber: 15
                  }
                }), /*#__PURE__*/_react["default"].createElement("div", {
                  key: "suffix3",
                  "data-hook": "suffix3",
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 93,
                    columnNumber: 15
                  }
                })],
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 89,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext5.driver;
              _context5.t0 = expect;
              _context5.next = 4;
              return driver.getSuffixCount();
            case 4:
              _context5.t1 = _context5.sent;
              (0, _context5.t0)(_context5.t1).toBe(2);
              _context5.t2 = expect;
              _context5.next = 9;
              return driver.elementExistsByHook('suffix1');
            case 9:
              _context5.t3 = _context5.sent;
              (0, _context5.t2)(_context5.t3).toBe(true);
              _context5.t4 = expect;
              _context5.next = 14;
              return driver.elementExistsByHook('suffix2');
            case 14:
              _context5.t5 = _context5.sent;
              (0, _context5.t4)(_context5.t5).toBe(true);
              _context5.t6 = expect;
              _context5.next = 19;
              return driver.elementExistsByHook('suffix3');
            case 19:
              _context5.t7 = _context5.sent;
              (0, _context5.t6)(_context5.t7).toBe(false);
            case 21:
            case "end":
              return _context5.stop();
          }
        }, _callee5);
      })));
    });
    describe('disabled', function () {
      it('should be enabled by default', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
        var _renderWithContext6, driver;
        return _regenerator["default"].wrap(function _callee6$(_context6) {
          while (1) switch (_context6.prev = _context6.next) {
            case 0:
              _renderWithContext6 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 110,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext6.driver;
              _context6.t0 = expect;
              _context6.next = 4;
              return driver.isDisabled();
            case 4:
              _context6.t1 = _context6.sent;
              (0, _context6.t0)(_context6.t1).toBe(false);
            case 6:
            case "end":
              return _context6.stop();
          }
        }, _callee6);
      })));
      it('should be disabled when set to disabled', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7() {
        var _renderWithContext7, driver;
        return _regenerator["default"].wrap(function _callee7$(_context7) {
          while (1) switch (_context7.prev = _context7.next) {
            case 0:
              _renderWithContext7 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                disabled: true,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 118,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext7.driver;
              _context7.t0 = expect;
              _context7.next = 4;
              return driver.isDisabled();
            case 4:
              _context7.t1 = _context7.sent;
              (0, _context7.t0)(_context7.t1).toBe(true);
            case 6:
            case "end":
              return _context7.stop();
          }
        }, _callee7);
      })));
    });
    describe('selected', function () {
      it('should be selected if passed as selected from context', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8() {
        var _renderWithContext8, driver;
        return _regenerator["default"].wrap(function _callee8$(_context8) {
          while (1) switch (_context8.prev = _context8.next) {
            case 0:
              _renderWithContext8 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                itemKey: "simple",
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 128,
                  columnNumber: 11
                }
              }, "123"), {
                selectedPath: ['simple']
              }), driver = _renderWithContext8.driver;
              _context8.t0 = expect;
              _context8.next = 4;
              return driver.isSelected();
            case 4:
              _context8.t1 = _context8.sent;
              (0, _context8.t0)(_context8.t1).toBe(true);
            case 6:
            case "end":
              return _context8.stop();
          }
        }, _callee8);
      })));
      it('should not be selected if not passed as selected from context', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9() {
        var _renderWithContext9, driver;
        return _regenerator["default"].wrap(function _callee9$(_context9) {
          while (1) switch (_context9.prev = _context9.next) {
            case 0:
              _renderWithContext9 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                itemKey: "simple",
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 137,
                  columnNumber: 11
                }
              }, "123"), {
                selectedPath: []
              }), driver = _renderWithContext9.driver;
              _context9.t0 = expect;
              _context9.next = 4;
              return driver.isSelected();
            case 4:
              _context9.t1 = _context9.sent;
              (0, _context9.t0)(_context9.t1).toBe(false);
            case 6:
            case "end":
              return _context9.stop();
          }
        }, _callee9);
      })));
    });
    describe('onClick', function () {
      it('should call onClick handler', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0() {
        var onClickSpy, _renderWithContext0, driver;
        return _regenerator["default"].wrap(function _callee0$(_context0) {
          while (1) switch (_context0.prev = _context0.next) {
            case 0:
              onClickSpy = vi.fn();
              _renderWithContext0 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                onClick: onClickSpy,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 149,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext0.driver;
              _context0.next = 4;
              return driver.click();
            case 4:
              expect(onClickSpy).toHaveBeenCalledTimes(1);
            case 5:
            case "end":
              return _context0.stop();
          }
        }, _callee0);
      })));
      it('should not call onClick handler when disabled', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee1() {
        var onClickSpy, _renderWithContext1, driver;
        return _regenerator["default"].wrap(function _callee1$(_context1) {
          while (1) switch (_context1.prev = _context1.next) {
            case 0:
              onClickSpy = vi.fn();
              _renderWithContext1 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                onClick: onClickSpy,
                disabled: true,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 159,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext1.driver;
              _context1.next = 4;
              return driver.click();
            case 4:
              expect(onClickSpy).not.toHaveBeenCalled();
            case 5:
            case "end":
              return _context1.stop();
          }
        }, _callee1);
      })));
    });
    describe('skin', function () {
      Object.values(_constants.sidebarSkins).forEach(function (skin) {
        return it("should have skin: ".concat(skin), /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10() {
          var _renderWithContext10, driver;
          return _regenerator["default"].wrap(function _callee10$(_context10) {
            while (1) switch (_context10.prev = _context10.next) {
              case 0:
                _renderWithContext10 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 173,
                    columnNumber: 13
                  }
                }, "123"), {
                  skin: skin
                }), driver = _renderWithContext10.driver;
                _context10.t0 = expect;
                _context10.next = 4;
                return driver.getSkin();
              case 4:
                _context10.t1 = _context10.sent;
                (0, _context10.t0)(_context10.t1).toBe(skin);
              case 6:
              case "end":
                return _context10.stop();
            }
          }, _callee10);
        })));
      });
    });

    // TODO: styling detail, cover with visual tests
    describe('textSize', function () {
      it('should have small textSize as a first level item', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11() {
        var _renderWithContext11, driver;
        return _regenerator["default"].wrap(function _callee11$(_context11) {
          while (1) switch (_context11.prev = _context11.next) {
            case 0:
              _renderWithContext11 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 188,
                  columnNumber: 11
                }
              }, "123"), {
                level: 1
              }), driver = _renderWithContext11.driver;
              _context11.t0 = expect;
              _context11.next = 4;
              return driver.textSize();
            case 4:
              _context11.t1 = _context11.sent;
              (0, _context11.t0)(_context11.t1).toBe('small');
            case 6:
            case "end":
              return _context11.stop();
          }
        }, _callee11);
      })));
      it('should have tiny textSize as a second level item', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12() {
        var _renderWithContext12, driver;
        return _regenerator["default"].wrap(function _callee12$(_context12) {
          while (1) switch (_context12.prev = _context12.next) {
            case 0:
              _renderWithContext12 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 199,
                  columnNumber: 11
                }
              }, "123"), {
                level: 2
              }), driver = _renderWithContext12.driver;
              _context12.t0 = expect;
              _context12.next = 4;
              return driver.textSize();
            case 4:
              _context12.t1 = _context12.sent;
              (0, _context12.t0)(_context12.t1).toBe('tiny');
            case 6:
            case "end":
              return _context12.stop();
          }
        }, _callee12);
      })));
      it('should have tiny textSize as a third level item', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13() {
        var _renderWithContext13, driver;
        return _regenerator["default"].wrap(function _callee13$(_context13) {
          while (1) switch (_context13.prev = _context13.next) {
            case 0:
              _renderWithContext13 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 210,
                  columnNumber: 11
                }
              }, "123"), {
                level: 3
              }), driver = _renderWithContext13.driver;
              _context13.t0 = expect;
              _context13.next = 4;
              return driver.textSize();
            case 4:
              _context13.t1 = _context13.sent;
              (0, _context13.t0)(_context13.t1).toBe('tiny');
            case 6:
            case "end":
              return _context13.stop();
          }
        }, _callee13);
      })));
    });
    describe('as', function () {
      it('should set link when defined as anchor', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14() {
        var _renderWithContext14, getByRole, linkEl;
        return _regenerator["default"].wrap(function _callee14$(_context14) {
          while (1) switch (_context14.prev = _context14.next) {
            case 0:
              _renderWithContext14 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                as: "a",
                href: "https://www.wix.com",
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 223,
                  columnNumber: 11
                }
              }, "123")), getByRole = _renderWithContext14.getByRole;
              linkEl = getByRole('link', {
                name: '123'
              });
              expect(linkEl.getAttribute('href')).toBe('https://www.wix.com');
            case 3:
            case "end":
              return _context14.stop();
          }
        }, _callee14);
      })));
      it('should pass all props set in the as component', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15() {
        var _renderWithContext15, getByRole, linkEl;
        return _regenerator["default"].wrap(function _callee15$(_context15) {
          while (1) switch (_context15.prev = _context15.next) {
            case 0:
              _renderWithContext15 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                as: "a",
                href: "https://www.wix.com",
                "data-custom-prop": "custom-prop",
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 234,
                  columnNumber: 11
                }
              }, "123")), getByRole = _renderWithContext15.getByRole;
              linkEl = getByRole('link', {
                name: '123'
              });
              expect(linkEl.getAttribute('data-custom-prop')).toBe('custom-prop');
            case 3:
            case "end":
              return _context15.stop();
          }
        }, _callee15);
      })));
    });
    describe('title', function () {
      it('should render a given title', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16() {
        var _renderWithContext16, driver;
        return _regenerator["default"].wrap(function _callee16$(_context16) {
          while (1) switch (_context16.prev = _context16.next) {
            case 0:
              _renderWithContext16 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 251,
                  columnNumber: 11
                }
              }, "Item Title")), driver = _renderWithContext16.driver;
              _context16.t0 = expect;
              _context16.next = 4;
              return driver.getText();
            case 4:
              _context16.t1 = _context16.sent;
              (0, _context16.t0)(_context16.t1).toEqual('Item Title');
            case 6:
            case "end":
              return _context16.stop();
          }
        }, _callee16);
      })));
    });
    describe('onMouse', function () {
      it('should call onMouseEnter handler', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17() {
        var onMouseEnterSpy, _renderWithContext17, driver;
        return _regenerator["default"].wrap(function _callee17$(_context17) {
          while (1) switch (_context17.prev = _context17.next) {
            case 0:
              onMouseEnterSpy = vi.fn();
              _renderWithContext17 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                onMouseEnter: onMouseEnterSpy,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 261,
                  columnNumber: 11
                }
              }, "123")), driver = _renderWithContext17.driver;
              _context17.next = 4;
              return driver.hover();
            case 4:
              expect(onMouseEnterSpy).toHaveBeenCalledTimes(1);
            case 5:
            case "end":
              return _context17.stop();
          }
        }, _callee17);
      })));
      it('should call onMouseLeave handler', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee18() {
        var onMouseLeaveSpy, _renderWithContext18, driver;
        return _regenerator["default"].wrap(function _callee18$(_context18) {
          while (1) switch (_context18.prev = _context18.next) {
            case 0:
              onMouseLeaveSpy = vi.fn();
              _renderWithContext18 = renderWithContext(/*#__PURE__*/_react["default"].createElement(_SidebarItemNext["default"], {
                onMouseLeave: onMouseLeaveSpy,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 270,
                  columnNumber: 11
                }
              })), driver = _renderWithContext18.driver;
              _context18.next = 4;
              return driver.hover();
            case 4:
              _context18.next = 6;
              return driver.onMouseLeave();
            case 6:
              expect(onMouseLeaveSpy).toHaveBeenCalledTimes(1);
            case 7:
            case "end":
              return _context18.stop();
          }
        }, _callee18);
      })));
    });
  });
});