"use strict";

var _react = require("@testing-library/react");
var _PageNavigation = _interopRequireDefault(require("./PageNavigation"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
test('affiche la barre de navigation avec ses enfants', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PageNavigation.default, {
    variant: "card",
    ariaLabel: "Navigation test",
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: "Lien 1"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: "Lien 2"
    })]
  }));
  expect(_react.screen.getByTestId('page-navigation')).toHaveClass('page-navigation--card');
  expect(_react.screen.getByText('Lien 1')).toBeInTheDocument();
  expect(_react.screen.getByText('Lien 2')).toBeInTheDocument();
});
test('applique les variantes below-form et on-dark', () => {
  const _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PageNavigation.default, {
      variant: "below-form",
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
        children: "Sous formulaire"
      })
    })),
    rerender = _render.rerender;
  expect(_react.screen.getByTestId('page-navigation')).toHaveClass('page-navigation--below-form');
  rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PageNavigation.default, {
    variant: "on-dark",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: "Sur fond sombre"
    })
  }));
  expect(_react.screen.getByTestId('page-navigation')).toHaveClass('page-navigation--on-dark');
});
test('ignore un variant inconnu', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PageNavigation.default, {
    variant: "inconnu",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: "Inconnu"
    })
  }));
  expect(_react.screen.getByTestId('page-navigation')).not.toHaveClass('page-navigation--card');
});
test('utilise la variante card par defaut', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PageNavigation.default, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: "Defaut"
    })
  }));
  expect(_react.screen.getByTestId('page-navigation')).toHaveClass('page-navigation--card');
});
test('applique la variante inline par defaut sans classe supplementaire', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PageNavigation.default, {
    variant: "inline",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: "Inline"
    })
  }));
  const navigation = _react.screen.getByTestId('page-navigation');
  expect(navigation).toHaveClass('page-navigation');
  expect(navigation).not.toHaveClass('page-navigation--card');
});