Ringtone app
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

index.test.tsx 597 B

3 år sedan
3 år sedan
3 år sedan
3 år sedan
12345678910111213141516171819
  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. })