Common front-end components for Web using the Tesseract design system, written for React. https://make.modal.sh/tesseract/web/react/common
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

38 wiersze
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