"use strict";

var _react = _interopRequireDefault(require("react"));
var _enzyme = require("enzyme");
var _index = _interopRequireDefault(require("./index"));
var _noop = _interopRequireDefault(require("lodash/noop"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/* eslint-env jest */

var mockedPriceData = [{
  key: 'Damen Polo Organic, JAMES & NICHOLSON',
  identifier: 'precosts',
  label: 'Damen Polo Organic, JAMES & NICHOLSON',
  selectable: false,
  price: '98,00 €'
}, {
  key: 'Vorkosten',
  identifier: 'precosts',
  label: 'Vorkosten',
  selectable: false,
  price: '29,00 €'
}, {
  key: 'Werbedruck',
  identifier: 'advertisePrinting',
  label: 'Werbedruck',
  selectable: false,
  price: '42,00 €'
}, {
  key: 'Logokosten',
  identifier: 'logisticsCosts',
  label: 'Logokosten',
  selectable: false,
  price: '0,00 €'
}, {
  key: 'Korrekturanzug',
  identifier: 'proof',
  label: 'Korrekturabzug',
  selectable: true,
  price: '0,00 €'
}, {
  key: 'Korrekturmuster',
  identifier: 'correctionDraft',
  label: 'Korrekturmuster',
  selectable: true,
  price: '0,00 €'
}];
var getDefaultComponent = function getDefaultComponent() {
  return /*#__PURE__*/_react["default"].createElement("div", null);
};
it('renders correctly', function () {
  var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    width: "lg",
    amount: 100,
    priceFormatted: "500,00 \u20AC",
    vatNotice: "VAT included plus shipping",
    priceList: mockedPriceData,
    onChangeAmount: _noop["default"],
    ConfigurationModeSwitchComponent: getDefaultComponent
  }));
  expect(tree).toMatchSnapshot();
});
it('renders a boxed component with the boxed prop', function () {
  var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    width: "lg",
    amount: 100,
    boxed: true,
    priceFormatted: "500,00 \u20AC",
    vatNotice: "VAT included plus shipping",
    ConfigurationModeSwitchComponent: getDefaultComponent
  }));
  expect(tree).toMatchSnapshot();
});
it('renders the ConfigurationModeSwitchComponent (if it is provided)', function () {
  var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    width: "lg",
    amount: 100,
    priceFormatted: "500,00 \u20AC",
    vatNotice: "VAT included plus shipping",
    priceList: mockedPriceData,
    onChangeAmount: _noop["default"],
    showConfigurationModeSwitch: true,
    ConfigurationModeSwitchComponent: function ConfigurationModeSwitchComponent() {
      return /*#__PURE__*/_react["default"].createElement("div", null, "Switch to Design!");
    }
  }));
  expect(tree).toMatchSnapshot();
});
it('renders without callToAction', function () {
  var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    showCallToAction: false,
    width: "lg",
    amount: 100,
    priceFormatted: "500,00 \u20AC",
    vatNotice: "VAT included plus shipping",
    priceList: mockedPriceData,
    onChangeAmount: _noop["default"],
    showConfigurationModeSwitch: true,
    ConfigurationModeSwitchComponent: function ConfigurationModeSwitchComponent() {
      return /*#__PURE__*/_react["default"].createElement("div", null, "Switch to Design!");
    }
  }));
  expect(tree).toMatchSnapshot();
});
it('renders receiveOfferForm', function () {
  var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    showReceiveOfferForm: true,
    width: "lg",
    amount: 100,
    priceFormatted: "500,00 \u20AC",
    vatNotice: "VAT included plus shipping",
    priceList: mockedPriceData,
    onChangeAmount: _noop["default"],
    showConfigurationModeSwitch: true,
    ConfigurationModeSwitchComponent: function ConfigurationModeSwitchComponent() {
      return /*#__PURE__*/_react["default"].createElement("div", null, "Switch to Design!");
    }
  }));
  expect(tree).toMatchSnapshot();
});