Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

38 行
874 B

  1. import * as fc from 'fast-check'
  2. import * as Enzyme from 'enzyme'
  3. import * as Axe from 'jest-axe'
  4. import * as React from 'react'
  5. import {{pascalCase name}} from './{{pascalCase name}}'
  6. it('should exist', () => {
  7. expect({{pascalCase name}}).toBeDefined()
  8. })
  9. it('should be a component', () => {
  10. expect({{pascalCase name}}).toBeComponent()
  11. })
  12. it('should render without crashing given required props', () => {
  13. expect(() => <{{pascalCase name}} name="" />).not.toThrow()
  14. })
  15. it('should guarantee minimal accessibility', () => {
  16. fc.assert(
  17. fc.asyncProperty(
  18. fc.string(1, 20),
  19. async s => {
  20. const wrapper = Enzyme.mount(
  21. <{{pascalCase name}}
  22. name={s}
  23. />
  24. )
  25. const results = await Axe.axe(wrapper.getDOMNode())
  26. expect(results).toHaveNoViolations()
  27. }
  28. )
  29. )
  30. })
  31. // TODO add more tests