"use strict";

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

var _enzyme = require("enzyme");

var _themeProvider = _interopRequireDefault(require("../theme-provider"));

var _styled = _interopRequireDefault(require("../styled"));

var _testUtils = require("../../test/test-utils");

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-disable */
jest.unmock('../styled.js');
test('<ThemeProvider />', function () {
  var StyledMockButton = (0, _styled.default)('button', function (_ref) {
    var theme = _ref.theme;
    return {
      backgroundColor: 'red'
    };
  });
  var TestComponent = (0, _testUtils.withStyletronProvider)(function () {
    return _react.default.createElement(_themeProvider.default, {
      theme: "red"
    }, _react.default.createElement(StyledMockButton, {
      id: "testButton"
    }));
  });
  var wrapper = (0, _enzyme.mount)(_react.default.createElement(TestComponent, null));
  var button = wrapper.find('#testButton').children().at(0);
  expect(button.props().$theme).toBe('red');
  wrapper.unmount();
});