import React from 'react' import { render } from '@testing-library/react' import { type CustomButtonProps } from '..' import { IconButton } from './IconButton' describe('', () => { it("renders an accessible label when it's a link", () => { const { getByLabelText } = render( , ) expect(getByLabelText('Accessible label on the link version')).toBeInTheDocument() }) it("renders an accessible label when it's a button", () => { const { getByLabelText } = render( undefined} label="Accessible label on the button version" />, ) expect(getByLabelText('Accessible label on the button version')).toBeInTheDocument() }) it("renders an accessible label when it's a custom component", () => { const CustomComponent = (buttonProps: CustomButtonProps): JSX.Element => (
) const { getByLabelText } = render( , ) expect(getByLabelText('Accessible label on the custom component version')).toBeInTheDocument() }) })