import * as React from 'react'; import { render } from '@testing-library/react'; import { ButtonArrow } from '@govuk-react/icons'; import { Button } from '.'; const ButtonStart: React.FC = (props) => ( ); const ButtonStartIcon: React.FC = () => ( ); const ButtonDisabled: React.FC = () => ; describe('button', () => { describe('basics', () => { it('should render a button', () => { const { getByRole, getByText } = render(); expect(getByRole('button')).toBeInTheDocument(); expect(getByRole('button')).toEqual(getByText('Example')); }); }); describe('disabled', () => { it('should render a button with the disabled attribute', () => { const { getByRole } = render(); expect(getByRole('button')).toBeDisabled(); }); }); describe('start button', () => { it('should render a button with the isStart prop', () => { const { getByRole } = render(); expect(getByRole('button')).toBeInTheDocument(); }); }); describe('button with icon', () => { it('should render an SVG icon within the button', () => { const { container } = render(); expect(container.querySelectorAll('svg').length).toEqual(1); }); }); });