import React from 'react'; import axe from '../../../../axe-helper'; import { render } from '@testing-library/react'; import Progress from './Progress'; describe(' Props', () => { it('renders the component with the step text', () => { const { getByText } = render(); expect(getByText('Step 2 of 5')).toBeTruthy(); }); it('renders the component without the step text', () => { const { queryByText } = render(); expect(queryByText('Step 2 of 5')).toBeFalsy(); }); it('renders empty progress bar', () => { const { container } = render(); expect(container.firstChild).toMatchSnapshot(); }); it('renders full progress bar', () => { const { container } = render(); expect(container.firstChild).toMatchSnapshot(); }); }); describe(' Accessibility', () => { it('renders the component with props with no a11y violations', async () => { const { container } = render(); expect(container).toMatchSnapshot(); const results = await axe(container.innerHTML); expect(results).toHaveNoViolations(); }); });