"use strict";

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

var _enzyme = require("enzyme");

var _index = require("../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('FileUploader styled components', function () {
  var styledComponents = [[_index.StyledFileDragAndDrop, 'StyledFileDragAndDrop'], [_index.StyledContentMessage, 'StyledContentMessage'], [_index.StyledErrorMessage, 'StyledErrorMessage'], [_index.StyledRoot, 'StyledRoot'], [_index.StyledHiddenInput, 'StyledHiddenInput']];
  test.each(styledComponents)('default properties', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, null));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has expected default styles"));
  });
  test.each(styledComponents)('disabled', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $isDisabled: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has expected styles when disabled"));
  });
  test.each(styledComponents)('drag active', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $isDragActive: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has expected styles when drag active"));
  });
  test.each(styledComponents)('drag accept', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $isDragAccept: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has expected styles when drag accept"));
  });
  test.each(styledComponents)('drag reject', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $isDragReject: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has expected styles when drag reject"));
  });
  test.each(styledComponents)('focused', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $isFocused: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has expected styles when focused"));
  });
  test.each(styledComponents)('afterFileDrop', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $afterFileDrop: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has expected styles when after files are dropped"));
  });
});