"use strict";

var _react = require("@testing-library/react");
var _RegistrationsList = _interopRequireDefault(require("./RegistrationsList"));
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const sampleRegistrations = [{
  nom: 'Dupont',
  prenom: 'Jean',
  email: 'jean.dupont@email.com',
  dateOfBirth: '1990-01-01',
  ville: 'Paris',
  codePostal: '75001'
}];
test('affiche un message quand la liste est vide', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistrationsList.default, {
    registrations: []
  }));
  expect(_react.screen.getByTestId('no-registrations')).toBeInTheDocument();
});
test('affiche les inscriptions et peut mettre en evidence une ligne', () => {
  (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistrationsList.default, {
    registrations: sampleRegistrations,
    highlightedIndex: 0
  }));
  const item = _react.screen.getByTestId('registration-item');
  expect(item).toHaveTextContent('Jean Dupont');
  expect(item).toHaveClass('registration-item-highlight');
});