/*
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 */
import React from 'react';
import { shallow } from 'enzyme';
import { ModalButton } from '../index.js';
import { Button, KIND } from '../../button/index.js';
import { LightTheme } from '../../themes/index.js';
import createMockTheme from '../../test/create-mock-theme.js';
var mockTheme = createMockTheme(LightTheme);
describe('ModalButton', function () {
  test('renders modal button with correct styles', function () {
    var overrides = {
      BaseButton: {
        style: {
          color: 'red'
        }
      }
    };
    var wrapper = shallow(React.createElement(ModalButton, {
      kind: KIND.tertiary,
      overrides: overrides
    }, "Hello World"));
    var button = wrapper.find(Button);
    expect(button).toExist();
    expect(button).toHaveProp('kind', KIND.tertiary);
    var mergedOverrides = button.prop('overrides');
    var result = mergedOverrides.BaseButton.style({
      $theme: mockTheme
    });
    expect(result).toEqual({
      color: 'red',
      marginLeft: '$theme.sizing.scale500'
    });
  });
});