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

import Header, {
  HeaderTitle,
  HeaderSection,
  HeaderLogo,
} from '@digigov/ui/app/Header';
import logo from '../../govgr/GovGRLogo/govgr-logo.svg';

it('renders the header with logo, title and subtitle', () => {
  expect(
    render(
      <Header>
        <HeaderLogo src={logo} href="https://gov.gr" altText="govgr logo" />
        <HeaderTitle href="/some-url">A title</HeaderTitle>
        <HeaderSection>A subtitle</HeaderSection>
      </Header>
    ).baseElement
  ).toMatchSnapshot();
});

it('renders the HeaderTitle component', () => {
  expect(
    render(<HeaderTitle>A title</HeaderTitle>).baseElement
  ).toMatchSnapshot();
});

it('renders the HeaderTitle component with custom href', () => {
  expect(
    render(<HeaderTitle href={'/somelink'}>A title</HeaderTitle>).baseElement
  ).toMatchSnapshot();
});
