"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _enzyme = require("enzyme");

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

var _CardContent = _interopRequireDefault(require("../CardContent"));

var _CardWrapper = _interopRequireDefault(require("../CardWrapper"));

describe('Card', function () {
  it('renders CardContent', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.default, null, "Cool Content"));
    var content = wrapper.find(_CardContent.default);
    expect(content.prop('children')).to.equal('Cool Content');
  });
  it('passes props to CardContent', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.default, {
      className: "myClass",
      "data-automation": "card-for-testing"
    }, "Cool Content"));
    var content = wrapper.find(_CardContent.default);
    expect(content.prop('className')).to.equal('myClass');
    expect(content.prop('data-automation')).to.equal('card-for-testing');
  });
  it('renders CardWrapper if wrapped', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.default, {
      wrapped: true
    }, "Cool Content"));
    var content = wrapper.find(_CardWrapper.default).find(_CardContent.default);
    expect(content.prop('children')).to.equal('Cool Content');
  });
  it('passes wrapperClassName to CardWrapper', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.default, {
      wrapped: true,
      wrapperClassName: "myWrapperClass"
    }, "Cool Content"));
    expect(wrapper.find(_CardWrapper.default).prop('className')).to.equal('myWrapperClass');
  });
});