"use strict";

var _react = require("@testing-library/react");
var _useNonNativeButtonAttrs = require("./use-non-native-button-attrs");
describe('useNonNativeButtonAttrs hook', function () {
  const defaults = {
    isDisabled: false,
    onClick: jest.fn(),
    onKeyDown: jest.fn(),
    tabIndex: 0
  };
  it('should return correct attributes if element is enabled', function () {
    const {
      result
    } = (0, _react.renderHook)(() => (0, _useNonNativeButtonAttrs.useNonNativeButtonAttrs)(defaults));
    expect(result.current).toEqual({
      tabIndex: 0,
      'aria-disabled': false,
      role: 'button',
      onClick: expect.any(Function),
      onKeyDown: expect.any(Function)
    });
  });
  it('should return correct attributes if element is disabled', function () {
    const {
      result
    } = (0, _react.renderHook)(() => (0, _useNonNativeButtonAttrs.useNonNativeButtonAttrs)({
      ...defaults,
      isDisabled: true
    }));
    expect(result.current).toEqual({
      tabIndex: -1,
      'aria-disabled': true,
      role: 'button',
      onClick: expect.any(Function),
      onKeyDown: expect.any(Function)
    });
  });
});