import React from 'react' import { render } from 'react-testing-library' import { BrowserRouter as Router } from 'react-router-dom' import Button from './Button' describe('Button', () => { it('default renders correctly without crashing', () => { const { getByTestId } = render( ) expect(getByTestId('button-default')).toHaveTextContent('default') }) it('primary renders correctly without crashing', () => { const { getByTestId } = render( ) expect(getByTestId('button-primary')).toHaveTextContent('primary') expect(getByTestId('button-primary').className).toMatch(/buttonPrimary/) }) it('Link renders correctly without crashing', () => { const { getByTestId } = render( ) expect(getByTestId('button-to')).toHaveTextContent('Link') }) it('href renders correctly without crashing', () => { const { getByTestId } = render( ) expect(getByTestId('button-href')).toHaveTextContent('href') expect(getByTestId('button-href').nodeName).toBe('A') }) it('link renders correctly without crashing', () => { const { getByTestId } = render( ) expect(getByTestId('button-link')).toHaveTextContent('link') expect(getByTestId('button-link').className).toMatch(/link/) }) })