aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/forms/index.ts
blob: 7e444c2651c88be9b7522b2663dad0de4e7dcc9a (plain)
1
2
3
4
5
export * from './fields';
export * from './fieldset';
export * from './form';
export * from './label';
export * from './legend';
ght .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
import { render, screen } from '@test-utils';
import Branding from './branding';

describe('Branding', () => {
  it('renders a photo', () => {
    render(
      <Branding
        photo="http://placeimg.com/640/480/city"
        title="Website title"
      />
    );
    expect(
      screen.getByRole('img', { name: 'Website title picture' })
    ).toBeInTheDocument();
  });

  it('renders a logo', () => {
    render(
      <Branding photo="http://placeimg.com/640/480/city" title="Website name" />
    );
    expect(screen.getByTitle('Website name logo')).toBeInTheDocument();
  });

  it('renders a baseline', () => {
    render(
      <Branding
        photo="http://placeimg.com/640/480"
        title="Website title"
        baseline="Website baseline"
      />
    );
    expect(screen.getByText('Website baseline')).toBeInTheDocument();
  });

  it('renders a title wrapped with h1 element', () => {
    render(
      <Branding
        photo="http://placeimg.com/640/480"
        title="Website title"
        isHome={true}
      />
    );
    expect(
      screen.getByRole('heading', { level: 1, name: 'Website title' })
    ).toBeInTheDocument();
  });

  it('renders a title with h1 styles', () => {
    render(
      <Branding
        photo="http://placeimg.com/640/480"
        title="Website title"
        isHome={false}
      />
    );
    expect(
      screen.queryByRole('heading', { level: 1, name: 'Website title' })
    ).not.toBeInTheDocument();
    expect(screen.getByText('Website title')).toHaveClass('heading--1');
  });
});