"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _ScrollButton = require("../ScrollButton");
var _ScrollButtons = _interopRequireDefault(require("../ScrollButtons"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var props = {
  focusableScrollButtons: 'false',
  nop: function nop() {},
  preventBubblingOnKeyDown: 'false',
  rtl: 'false',
  vertical: 'false'
};
describe('ScrollButton specs', function () {
  // ref property can't be accessed with react testing library. This test is only for increasing code coverage - [feature/WRP-3081]
  test('should accept a function as `ref` prop', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollButton.ScrollButton, {
      icon: "circle",
      ref: function ref() {}
    }));
    var button = _react.screen.getByRole('button');
    expect(button).toBeInTheDocument();
  });
});
describe('ScrollButtons specs', function () {
  test('should return `true` for `isOneOfScrollButtonsFocused`', function () {
    var functions = (0, _react.renderHook)(function () {
      return (0, _ScrollButtons["default"])(props);
    }).result.current;
    var aux;
    (0, _react.act)(function () {
      aux = functions.isOneOfScrollButtonsFocused();

      // functions called in order to increase code coverage
      functions.focusOnButton();
      functions.onClickNext();
      functions.onClickPrev();
      functions.updateButtons({
        scrollLeft: 1,
        maxLeft: 0
      });
    });
    expect(aux).toBe(true);
  });
});