"use strict";

var _react = _interopRequireDefault(require("react"));

var _enzyme = require("enzyme");

var _index = require("../index");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: 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.
*/
describe('Popover styled components', function () {
  test('StyledBody - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledBody, {
      $isOpen: false,
      $isAnimating: false,
      $placement: "bottomLeft",
      $arrowOffset: {
        top: 0,
        left: 0
      },
      $popoverOffset: {
        top: 0,
        left: 0
      },
      $showArrow: true
    }, _react.default.createElement("div", null)));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledBody has correct styles when closed');
    component.setProps({
      $isOpen: true,
      $isAnimating: true,
      $arrowOffset: {
        top: 0,
        left: 10
      },
      $popoverOffset: {
        top: 100,
        left: 100
      }
    });
    expect(component.instance().getStyles()).toMatchSnapshot('StyledBody has correct styles when open and animating');
  });
  test('StyledInner - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledInner, {
      $isOpen: true,
      $isAnimating: true,
      $placement: "bottomLeft",
      $arrowOffset: {
        top: 0,
        left: 10
      },
      $popoverOffset: {
        top: 100,
        left: 100
      },
      $showArrow: true
    }, _react.default.createElement("div", null)));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledInner has correct styles');
  });
  test('StyledArrow - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledArrow, {
      $isOpen: true,
      $isAnimating: true,
      $placement: "bottomLeft",
      $arrowOffset: {
        top: 0,
        left: 10
      },
      $popoverOffset: {
        top: 100,
        left: 100
      },
      $showArrow: true
    }, _react.default.createElement("div", null)));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledArrow has correct styles');
  });
  test('StyledPadding - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledPadding, null, _react.default.createElement("div", null)));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledPadding has correct styles');
  });
  test('StyledPadding - style override', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledPadding, {
      $style: {
        padding: '21px',
        color: 'red'
      }
    }, _react.default.createElement("div", null)));
    expect(component.instance().getStyles()).toEqual({
      padding: '21px',
      color: 'red'
    });
  });
});