"use strict";

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

var _enzyme = require("enzyme");

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

var _button = require("../../button");

var _themes = require("../../themes");

var _createMockTheme = _interopRequireDefault(require("../../test/create-mock-theme"));

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.
*/

/* eslint-env browser */
var mockTheme = (0, _createMockTheme.default)(_themes.LightTheme);
describe('ModalButton', function () {
  test('renders modal button with correct styles', function () {
    var overrides = {
      BaseButton: {
        style: {
          color: 'red'
        }
      }
    };
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.ModalButton, {
      kind: _button.KIND.tertiary,
      overrides: overrides
    }, "Hello World"));
    var button = wrapper.find(_button.Button);
    expect(button).toExist();
    expect(button).toHaveProp('kind', _button.KIND.tertiary);
    var mergedOverrides = button.prop('overrides');
    var result = mergedOverrides.BaseButton.style({
      $theme: mockTheme
    });
    expect(result).toEqual({
      color: 'red',
      marginLeft: '$theme.sizing.scale500'
    });
  });
});