"use strict";

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

var _enzyme = require("enzyme");

var _ChartTitle = _interopRequireDefault(require("./ChartTitle"));

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

describe("ChartTitle", function () {
  it("should render a title and subtitle when provided", function () {
    var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_ChartTitle["default"], {
      title: "Fun title",
      subtitle: "Fun subtitle"
    }));
    expect(wrapper.find("h2").text()).to.eql("Fun title");
    expect(wrapper.find("h3").text()).to.eql("Fun subtitle");
  });
  it("should neither render a title nor a subtitle when neither are provided", function () {
    var wrapper = (0, _enzyme.mount)(_react["default"].createElement(_ChartTitle["default"], null));
    expect(wrapper.find("h2").length).to.eql(0);
    expect(wrapper.find("h3").length).to.eql(0);
  });
});