"use strict";

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

var _enzyme = _interopRequireWildcard(require("enzyme"));

var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));

var _ = _interopRequireDefault(require("../"));

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

_enzyme.default.configure({
  adapter: new _enzymeAdapterReact.default()
});

describe('<Card />', function () {
  test('should render a tag with children, if given href', function () {
    var content = 'hello';
    var wrapper = (0, _enzyme.mount)(_react.default.createElement(_.default, {
      href: "something"
    }, content));
    var aTagChildren = wrapper.find('a').props().children;
    expect(aTagChildren).toEqual(content);
  });
  test('should render div with children by default', function () {
    var content = 'hello';
    var wrapper = (0, _enzyme.mount)(_react.default.createElement(_.default, null, content));
    var aTagChildren = wrapper.find('div').props().children;
    expect(aTagChildren).toEqual(content);
  });
  test('should forward all the props to a tag', function () {
    var href = 'cj.com';
    var fakeProps = {
      href: href
    };
    var wrapper = (0, _enzyme.mount)(_react.default.createElement(_.default, fakeProps));
    var aTagProps = wrapper.find('a').props();
    expect(aTagProps.href).toEqual(href);
  });
});