function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import * as React from 'react';
import { shallow } from 'enzyme';
import { Popover } from '../../popover/index.js';
import { Tooltip, StyledArrow, StyledInner, ACCESSIBILITY_TYPE, PLACEMENT, TRIGGER_TYPE } from '../index.js';
import baseDefaultProps from '../default-props.js';
describe('Tooltip', function () {
  test('basic render', function () {
    var props = {
      accessibilityType: ACCESSIBILITY_TYPE.none,
      content: jest.fn(),
      id: 'mock-id',
      isOpen: true,
      onBlur: jest.fn(),
      onClick: jest.fn(),
      onEsc: jest.fn(),
      onFocus: jest.fn(),
      onMouseEnter: jest.fn(),
      onMouseEnterDelay: 100,
      onMouseLeave: jest.fn(),
      onMouseLeaveDelay: 200,
      overrides: {
        Body: {
          component: function CustomBody(props) {
            // eslint-disable-next-line react/prop-types
            return React.createElement("div", null, props.children);
          },
          style: {
            width: '300px'
          }
        }
      },
      placement: PLACEMENT.topLeft,
      showArrow: true,
      triggerType: TRIGGER_TYPE.hover
    };
    var button = React.createElement("button", {
      type: "button"
    }, "Hover me");
    var component = shallow(React.createElement(Tooltip, props, button));
    expect(component.type()).toBe(Popover);
    expect(component.props()).toEqual(_objectSpread({}, baseDefaultProps, props, {
      children: button,
      ignoreBoundary: false,
      overrides: {
        Arrow: {
          component: StyledArrow
        },
        Body: {
          component: props.overrides.Body.component,
          style: {
            width: '300px'
          }
        },
        Inner: {
          component: StyledInner
        }
      }
    }));
  });
});