import * as React from 'react';
import { render } from '@testing-library/react';

import {
  Details,
  DetailsContent,
  DetailsSummary,
} from '@digigov/ui/content/Details';

it('renders the closed Details component', () => {
  expect(
    render(
      <Details>
        <DetailsSummary>Help with nationality</DetailsSummary>
        <DetailsContent>
          We need to know your nationality so we can work out which elections
          you’re entitled to vote in. If you cannot provide your nationality,
          you’ll have to send copies of identity documents through the post.
        </DetailsContent>
      </Details>
    ).baseElement
  ).toMatchSnapshot();
});

it('renders the open Details component', () => {
  expect(
    render(
      <Details open>
        <DetailsSummary>Help with nationality</DetailsSummary>
        <DetailsContent>
          We need to know your nationality so we can work out which elections
          you’re entitled to vote in. If you cannot provide your nationality,
          you’ll have to send copies of identity documents through the post.
        </DetailsContent>
      </Details>
    ).baseElement
  ).toMatchSnapshot();
});
