Ringtone app
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

20 行
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. })