"use strict";

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

var _enzyme = require("enzyme");

var _grid = require("./grid");

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

describe("Grid", function () {
  it("renders correctly", function () {
    var grid = (0, _enzyme.render)(_react["default"].createElement(_grid.GridContainer, null, _react["default"].createElement(_grid.Grid, null, _react["default"].createElement(_grid.GridCell, null, _react["default"].createElement("p", null, "Content")), _react["default"].createElement(_grid.GridCell, null, _react["default"].createElement("p", null, "More content")))));
    expect(grid).toMatchSnapshot();
  });
  describe("when given a className", function () {
    it("appends it to the root element", function () {
      var component = (0, _enzyme.shallow)(_react["default"].createElement(_grid.Grid, {
        className: "extra-class"
      }, "Text"));
      expect(component.prop("className").includes("extra-class")).toBe(true);
    });
  });
  describe("when given an unknown prop", function () {
    it("passes it to the root element", function () {
      // @ts-ignore: `unknownProps` is not part of any typed interface and therefore a good test value.
      var component = (0, _enzyme.shallow)(_react["default"].createElement(_grid.Grid, {
        unknownProp: "some value"
      }, "Text")); // @ts-ignore: toHaveProp exists from jest-enzyme, but TS isn't picking it up

      expect(component).toHaveProp({
        unknownProp: "some value"
      });
    });
  });
});