import React from 'react';
import renderWithTheme from '../../../testUtils/renderWithTheme';

import PageHeader from '../index';

describe('Page Header', () => {
  it('renders title and breadcrumb items', () => {
    const { getByText } = renderWithTheme(
      <PageHeader
        breadcrumbItems={[
          { href: '/?path=/story/pageheader--basic-page-header', text: 'Home' },
          {
            href: '/?path=/story/pageheader--basic-page-header',
            text: 'Components',
          },
        ]}
        title="Page Header"
      />
    );

    // expect to render title of page header
    expect(getByText('Page Header')).toBeInTheDocument();

    // expect to render breadcrumb items
    expect(getByText('Home')).toBeInTheDocument();
    expect(getByText('Components')).toBeInTheDocument();
  });
});
