"use strict";

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

var _enzyme = require("enzyme");

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

var _index2 = require("../../icon/index.js");

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('Spinner', function () {
  test('renders spinner icon', function () {
    var renderedIcon;
    var spinner = (0, _enzyme.mount)(_react.default.createElement(_index.Spinner, null)); // renderedRoot = wrapper.find(StyledSvg).first();

    renderedIcon = spinner.find(_index2.Spinner).first();
    expect(renderedIcon).toExist(); // pass new size value set to 56

    spinner.setProps({
      size: 56
    });
    renderedIcon = spinner.find(_index2.Spinner).first();
    expect(renderedIcon.props().size).toBe(56);
  });
  test('component overrides', function () {
    var overrides = {
      Svg: jest.fn().mockImplementation(function (_ref) {
        var children = _ref.children;
        return _react.default.createElement("svg", null, children);
      })
    };
    var wrapper = (0, _enzyme.mount)( // $FlowFixMe
    _react.default.createElement(_index.Spinner, {
      overrides: overrides
    }));
    var root = wrapper.find(overrides.Svg);
    expect(root).toHaveLength(1);
  });
});