"use strict";

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

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

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

var _enzyme = require("enzyme");

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

describe('Page', function () {
  it('passes contentRole to main div', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.default, {
      contentRole: "form"
    }, "content"), {
      disableLifecycleMethods: true
    });
    expect(wrapper.find('div[role="form"]')).to.have.length(1);
  });
  it('passes props to sidebar', function () {
    function Sidebar(props) {
      return _react.default.createElement("div", props);
    }

    var sidebarRole = 'complementary';
    var sidebarProps = {
      sidebarOpen: true,
      toggleSidebar: Function.prototype
    };
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.default, Object.assign({
      sidebarComponent: Sidebar,
      sidebarRole: sidebarRole
    }, sidebarProps), "content"), {
      disableLifecycleMethods: true
    });
    var sidebar = wrapper.find(Sidebar);
    expect(sidebar.props()).to.deep.equal((0, _objectSpread2.default)({
      role: sidebarRole
    }, sidebarProps));
  });
});