Ringtone app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 line
597 B

  1. import {render, screen} from '@testing-library/react'
  2. import ActionButton from '.'
  3. describe('button component for triggering actions', () => {
  4. it('should render a button element with a no-op action', () => {
  5. render(<ActionButton />)
  6. expect(screen.getByRole('button')).toBeInTheDocument()
  7. })
  8. describe.each(['button', 'reset', 'submit'] as const)('on %p action', (type) => {
  9. beforeEach(() => {
  10. render(<ActionButton type={type} />)
  11. })
  12. it('should render a button element with a submit action', () => {
  13. expect(screen.getByRole('button')).toHaveAttribute('type', type)
  14. })
  15. })
  16. })