aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/buttons/back-to-top.test.tsx
blob: a775841e7185af4b897c8a451e31a20b4db552f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { describe, expect, it } from '@jest/globals';
import { render, screen as rtlScreen } from '../../../../tests/utils';
import { BackToTop } from './back-to-top';

describe('BackToTop', () => {
  it('renders a BackToTop link', () => {
    const id = 'top';

    render(<BackToTop to={id} />);

    expect(rtlScreen.getByRole('link')).toHaveAccessibleName('Back to top');
    expect(rtlScreen.getByRole('link')).toHaveAttribute('href', `#${id}`);
  });
});