"use strict";

var _react = _interopRequireDefault(require("react"));
var _sidebar = require("./sidebar");
var _testUtilities = require("testUtilities");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
 * @jest-environment jsdom
 */

var TEST_ANCHOR = "some text";
var TEST_INFO_ANCHOR = "some info text";
describe("Sidebar component test", function () {
  it(" * should render with no props", function () {
    var _renderWithProviders = (0, _testUtilities.renderWithProviders)( /*#__PURE__*/_react["default"].createElement(_sidebar.Sidebar, null)),
      container = _renderWithProviders.container;
    var result = container.querySelector("aside");
    expect(result && result.textContent).not.toBeNull();
  });
  it(" * should render on the right side", function () {
    var _renderWithProviders2 = (0, _testUtilities.renderWithProviders)( /*#__PURE__*/_react["default"].createElement(_sidebar.Sidebar, {
        right: true
      }, TEST_ANCHOR)),
      queryByText = _renderWithProviders2.queryByText;
    var result = queryByText(TEST_ANCHOR);
    expect(result && result.parentElement).toHaveStyleRule("flex-direction", "row-reverse");
  });
  it(" * should render with children", function () {
    var _renderWithProviders3 = (0, _testUtilities.renderWithProviders)( /*#__PURE__*/_react["default"].createElement(_sidebar.Sidebar, null, TEST_ANCHOR)),
      queryByText = _renderWithProviders3.queryByText;
    var result = queryByText(TEST_ANCHOR);
    expect(result && result.textContent).not.toBeNull();
  });
  it(" * should render with children and with content on sibling side", function () {
    var _renderWithProviders4 = (0, _testUtilities.renderWithProviders)( /*#__PURE__*/_react["default"].createElement(_sidebar.Sidebar, {
        info: TEST_INFO_ANCHOR
      }, TEST_ANCHOR)),
      queryByText = _renderWithProviders4.queryByText;
    var sidebarElement = queryByText(TEST_ANCHOR);
    var staticComponent = queryByText(TEST_INFO_ANCHOR);
    expect(sidebarElement && sidebarElement.textContent).toBe(TEST_ANCHOR);
    expect(staticComponent && staticComponent.textContent).toBe(TEST_INFO_ANCHOR);
  });
});