function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return 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.
*/
import React from 'react';
import { mount } from 'enzyme';
describe('Stateful slider', function () {
  var allProps, wrapper;
  beforeEach(function () {
    allProps = {};
    jest.mock('../slider', function () {
      return jest.fn(function () {
        return React.createElement("div", null, "test");
      });
    });
  });
  afterEach(function () {
    jest.restoreAllMocks();
    wrapper && wrapper.unmount();
  });
  test('should provide default styled components to render', function () {
    var _require = require('../index'),
        StyledRoot = _require.StyledRoot,
        StyledAxis = _require.StyledAxis,
        StyledTick = _require.StyledTick,
        StyledThumb = _require.StyledThumb,
        StyledTickBar = _require.StyledTickBar,
        StyledAxisRange = _require.StyledAxisRange,
        StatefulSlider = _require.StatefulSlider;

    allProps.overrides = {
      Root: StyledRoot,
      Axis: StyledAxis,
      Tick: StyledTick,
      Thumb: StyledThumb,
      TickBar: StyledTickBar,
      AxisRange: StyledAxisRange
    };

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

    wrapper = mount(React.createElement(StatefulSlider, allProps));
    var overrides = slider.mock.calls[0][0].overrides;
    expect(overrides).toEqual({
      Root: StyledRoot,
      Axis: StyledAxis,
      Tick: StyledTick,
      Thumb: StyledThumb,
      TickBar: StyledTickBar,
      AxisRange: StyledAxisRange
    });
  });
  test('should pass all the other props to stateless slider', function () {
    var otherProps = {
      someProp: 'some other slider prop'
    };
    allProps = _objectSpread({}, allProps, otherProps);

    var _require2 = require('../index'),
        StatefulSlider = _require2.StatefulSlider;

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

    wrapper = mount(React.createElement(StatefulSlider, allProps)); // eslint-disable-next-line no-unused-vars

    var _slider$mock$calls$1$ = slider.mock.calls[1][0],
        overrides = _slider$mock$calls$1$.overrides,
        rest = _objectWithoutProperties(_slider$mock$calls$1$, ["overrides"]);

    expect(rest).toMatchObject({
      someProp: 'some other slider prop'
    });
  });
});