"use strict";

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

var _enzyme = require("enzyme");

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

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('Slider styled components', function () {
  describe('StyledRoot', function () {
    test('StyledRoot', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledRoot, null, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledRoot has correct styles');
    });
  });
  describe('StyledAxis', function () {
    test('StyledAxis', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledAxis, null, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledAxis has correct styles');
    });
  });
  describe('StyledTick', function () {
    test('StyledTick', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledTick, null, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledTick has correct styles');
    });
  });
  describe('StyledTickBar', function () {
    test('StyledTickBar', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledTickBar, null, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledTickBar has correct styles');
    });
  }); //$FlowFixMe

  describe.each([['$isStart', 'Start Thumb'], ['$isEnd', 'End Thumb'], ['', 'Single Thumb']])('%%For %s thumb type', function (thumbType, thumbText) {
    //$FlowFixMe
    describe.each([['$disabled'], ['$isFocused'], ['$isError'], ['$isHovered']])('With special state %s', function (extraState) {
      test.each([[[10, 300], [50, 100], 1, 0, 'range'], [[80], [50, 100], 0, 0, 'not range'], [[10, 300], [50, 100], 1, 1, 'range'], [[80], [50, 100], 0, 0, 'not range']])('%% %% If thumb is in %s', function ($range, $value, $currentThumb, $index, text) {
        var props = {
          $value: $value,
          $currentThumb: $currentThumb,
          $index: $index,
          $max: $range[1],
          $min: $range[0],
          $isRange: $value.length > 1
        };
        props[thumbType] = true;
        props[extraState] = true;
        var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledThumb, props, _react.default.createElement("div", null)));
        expect(component.instance().getStyles()).toMatchSnapshot('StyledThumb has correct styles when type is ' + thumbText + ' and it is ' + text);
      });
    });
  });
  describe('StyledAxisRange', function () {
    test.each([[[10, 300], [50, 100], 'range'], [[80], [50, 100], 'not range']])('%% %% For %s slider', function ($range, $value, text) {
      var props = {
        $value: $value,
        $max: $range[1],
        $min: $range[0],
        $isRange: $value.length > 1
      };
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledAxisRange, props, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledAxisRange has correct styles when is ' + text + ' slider');
    });
  });
});