import React__default from 'react';
import { render, screen } from '@testing-library/react';
import Note from '../index.js';
import '../../objectWithoutProperties-TXwlfNxG.js';
import 'prop-types';
import 'classnames';
import '../../ck-icon/index.js';
import '../../extends-C4cduGrv.js';
import '../../ck-icon/assets/icon-map/index.js';
import '../../icon/index.js';
import '@fortawesome/react-fontawesome';
import '../../icon/icons.js';
import '../../icon/library.js';
import '@fortawesome/fontawesome-svg-core';
import '@fortawesome/pro-solid-svg-icons';
import '@fortawesome/pro-light-svg-icons';
import '@fortawesome/free-brands-svg-icons';
import '../../button/index.js';
import '../../defineProperty-CEd-kZQW.js';
import '@reach/visually-hidden';
import '../../slicedToArray-BB-AwwkK.js';
import '../../floating-ui.react-cWPyyUrN.js';
import '../../typeof-CgC7Bq6K.js';
import '../../toConsumableArray-dKQYsfpV.js';
import '../../index-qSfOyGhk.js';
import 'react-dom';
import '../../button/button-group.js';

test('Render title and message', function () {
  var _render = render( /*#__PURE__*/React__default.createElement(Note, {
    "data-testid": "note",
    type: "success",
    title: "Title",
    message: "Description",
    action: {
      label: "Action",
      onClick: function onClick() {
        return console.log("Click!");
      }
    }
  })),
      getByText = _render.getByText;

  expect(getByText("Title")).toBeInTheDocument();
  expect(getByText("Description")).toBeInTheDocument();
  expect(getByText("Action")).toBeInTheDocument();
}); // Render css and icon for different note types

test('Render green success', function () {
  var _render2 = render( /*#__PURE__*/React__default.createElement(Note, {
    "data-testid": "note",
    type: "success",
    title: "Template success"
  })),
      container = _render2.container;

  expect(screen.getByTestId("note")).toHaveClass("bg-green-50");
  expect(container.querySelector("svg[name=\"check-circle\"]")).toBeInTheDocument();
});
test('Render yellow warning', function () {
  var _render3 = render( /*#__PURE__*/React__default.createElement(Note, {
    "data-testid": "note",
    type: "warning",
    title: "Template warning"
  })),
      container = _render3.container;

  expect(screen.getByTestId("note")).toHaveClass("bg-yellow-50");
  expect(container.querySelector("svg[name=\"alert-circle\"]")).toBeInTheDocument();
});
test('Render blue info', function () {
  var _render4 = render( /*#__PURE__*/React__default.createElement(Note, {
    "data-testid": "note",
    type: "info",
    title: "Template info"
  })),
      container = _render4.container;

  expect(screen.getByTestId("note")).toHaveClass("bg-blue-50");
  expect(container.querySelector("svg[name=\"information-circle\"]")).toBeInTheDocument();
});
test('Render red error', function () {
  var _render5 = render( /*#__PURE__*/React__default.createElement(Note, {
    "data-testid": "note",
    type: "error",
    title: "Template error"
  })),
      container = _render5.container;

  expect(screen.getByTestId("note")).toHaveClass("bg-red-50");
  expect(container.querySelector("svg[name=\"alert-triangle\"]")).toBeInTheDocument();
}); // Small notes

test('Small notes do not render titles', function () {
  var _render6 = render( /*#__PURE__*/React__default.createElement(Note, {
    size: "sm",
    type: "success",
    title: "Title",
    message: "Description"
  })),
      queryByText = _render6.queryByText;

  expect(queryByText("Title")).not.toBeInTheDocument();
  expect(queryByText("Description")).toBeInTheDocument();
}); // Note supports className

test('classname is added to the note', function () {
  render( /*#__PURE__*/React__default.createElement(Note, {
    type: "error",
    className: "mr-2 ml-5"
  }, "Pro"));
  expect(screen.getByTestId("note")).toHaveClass("bg-red-50 mr-2 ml-5");
}); // Note works with custom children

test('children are rendered', function () {
  var _render7 = render( /*#__PURE__*/React__default.createElement(Note, {
    type: "info"
  }, "Custom text!")),
      getByText = _render7.getByText;

  expect(getByText("Custom text!")).toBeInTheDocument();
});
