"use strict";

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

var _enzyme = require("enzyme");

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('Stateful radiogroup', function () {
  var allProps, wrapper;
  beforeEach(function () {
    allProps = {};
  });
  afterEach(function () {
    jest.restoreAllMocks();
    wrapper && wrapper.unmount();
  });
  test('should provide overrides components to render', function () {
    jest.mock('../radio', function () {
      return jest.fn(function () {
        return _react.default.createElement("div", null, "test");
      });
    });

    var _require = require('../index'),
        StyledRoot = _require.StyledRoot,
        StyledLabel = _require.StyledLabel,
        StyledRadioMark = _require.StyledRadioMark,
        StyledInput = _require.StyledInput,
        StyledRadio = _require.StyledRadio,
        StatefulRadioGroup = _require.StatefulRadioGroup;

    allProps.overrides = {
      Root: StyledRoot,
      Label: StyledLabel,
      RadioMark: StyledRadioMark,
      Input: StyledInput
    };

    var radio = require('../radio');

    wrapper = (0, _enzyme.mount)(_react.default.createElement(StatefulRadioGroup, allProps, _react.default.createElement(StyledRadio, {
      value: "1"
    }, "First"), _react.default.createElement(StyledRadio, {
      value: "2"
    }, "Second"), _react.default.createElement(StyledRadio, {
      value: "3"
    }, "Third")));
    var overrides = radio.mock.calls[0][0].overrides;
    expect(overrides).toEqual({
      Root: StyledRoot,
      Checkmark: StyledRadioMark,
      Label: StyledLabel,
      Input: StyledInput
    });
  });
});