import React__default from 'react';
import { render, screen } from '@testing-library/react';
import TitleBar from '../title-bar.js';

describe("TitleBar", function () {
  test("if `content` is a string, it should be wrapped in an h2", function () {
    var content = "Example";

    var _render = render( /*#__PURE__*/React__default.createElement(TitleBar, {
      content: content
    })),
        container = _render.container;

    expect(container.querySelector("h2")).toBeInTheDocument();
    expect(screen.getByText(content)).toBeInTheDocument();
  });
  test("if `content` is a string object, it should be wrapped in an h2", function () {
    var content = new String("Example");

    var _render2 = render( /*#__PURE__*/React__default.createElement(TitleBar, {
      content: content
    })),
        container = _render2.container;

    expect(container.querySelector("h2")).toBeInTheDocument();
    expect(screen.getByText(content)).toBeInTheDocument();
  });
  test("if `content` is JSX, it should be rendered by itself", function () {
    var text = "Example";

    var _render3 = render( /*#__PURE__*/React__default.createElement(TitleBar, {
      content: /*#__PURE__*/React__default.createElement("h1", null, text)
    })),
        container = _render3.container;

    expect(container.querySelector("h2")).not.toBeInTheDocument();
    expect(container.querySelector("h1")).toBeInTheDocument();
    expect(screen.getByText(text)).toBeInTheDocument();
  });
});
