"use strict";

var _react = require("@testing-library/react");
var _reactRouterDom = require("react-router-dom");
var _NavLink = _interopRequireDefault(require("./NavLink"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
test('affiche un lien interne', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRouterDom.MemoryRouter, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_NavLink.default, {
      to: "/register",
      testId: "go-to-registration",
      variant: "primary",
      children: "Inscription"
    })
  }));
  const link = _react.screen.getByTestId('go-to-registration');
  expect(link).toHaveAttribute('href', '/register');
  expect(link).toHaveClass('nav-link--primary');
});
test('affiche un lien externe', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_NavLink.default, {
    href: "/docs/index.html",
    external: true,
    testId: "go-to-docs",
    theme: "dark",
    children: "Documentation"
  }));
  const link = _react.screen.getByTestId('go-to-docs');
  expect(link).toHaveAttribute('href', '/docs/index.html');
  expect(link).toHaveAttribute('target', '_blank');
  expect(link).toHaveClass('nav-link--on-dark');
});