"use strict";

var _dataSources = require("@mirai/data-sources");
var _locale = require("@mirai/locale");
var _react = require("@testing-library/react");
var _react2 = _interopRequireDefault(require("react"));
var _checkout = _interopRequireDefault(require("../../../Checkout/mocks/checkout.json"));
var _BookingSummary = require("../BookingSummary");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable react/prop-types */
const DEFAULTS = {
  dataSource: _checkout.default
};
const Store = _ref => {
  let {
    children
  } = _ref;
  return /*#__PURE__*/_react2.default.createElement(_dataSources.StoreProvider, {
    value: {}
  }, children);
};
describe('<BookingSummary>', () => {
  it('renders', async () => {
    const {
      asFragment
    } = (0, _react.render)(/*#__PURE__*/_react2.default.createElement(_locale.LocaleProvider, null, /*#__PURE__*/_react2.default.createElement(_BookingSummary.BookingSummary, DEFAULTS)));
    expect(asFragment()).toMatchSnapshot();
  });
  it('with a store', async () => {
    const {
      asFragment
    } = (0, _react.render)(/*#__PURE__*/_react2.default.createElement(Store, null, /*#__PURE__*/_react2.default.createElement(_locale.LocaleProvider, null, /*#__PURE__*/_react2.default.createElement(_BookingSummary.BookingSummary, DEFAULTS))));
    expect(asFragment()).toMatchSnapshot();
  });

  // Testing
  it('testID', async () => {
    const {
      asFragment,
      getByTestId
    } = (0, _react.render)(/*#__PURE__*/_react2.default.createElement(_locale.LocaleProvider, null, /*#__PURE__*/_react2.default.createElement(_BookingSummary.BookingSummary, _extends({}, DEFAULTS, {
      testId: "mirai"
    }))));
    expect(getByTestId('mirai')).toBeDefined();
    expect(asFragment()).toMatchSnapshot();
  });

  // Styling
  it('inherit:className', async () => {
    const {
      asFragment
    } = (0, _react.render)(/*#__PURE__*/_react2.default.createElement(_locale.LocaleProvider, null, /*#__PURE__*/_react2.default.createElement(_BookingSummary.BookingSummary, _extends({}, DEFAULTS, {
      className: "mirai"
    }))));
    expect(asFragment()).toMatchSnapshot();
  });
});
//# sourceMappingURL=BookingSummary.test.js.map