"use strict";

var _react = require("@testing-library/react");
var _Toast = _interopRequireDefault(require("./Toast"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
test('n affiche rien sans message', () => {
  const _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, {
      message: "",
      type: "success"
    })),
    container = _render.container;
  expect(container).toBeEmptyDOMElement();
});
test('affiche un toast de succes', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, {
    message: "Operation reussie",
    type: "success"
  }));
  const toast = _react.screen.getByTestId('success-toast');
  expect(toast).toHaveTextContent('Operation reussie');
  expect(toast).toHaveClass('toast-success');
});
test('affiche un toast d erreur par defaut', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, {
    message: "Une erreur"
  }));
  const toast = _react.screen.getByTestId('error-toast');
  expect(toast).toHaveTextContent('Une erreur');
  expect(toast).toHaveClass('toast-error');
});