PickerOption.jest.tsx 534 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import renderer from 'react-test-renderer';
  3. import PickerOption from './PickerOption';
  4. const model = {
  5. onSelect: () => {},
  6. onFocus: () => {},
  7. isFocused: () => {},
  8. option: {
  9. title: 'Model title',
  10. avatarUrl: 'url/to/avatar',
  11. label: 'User picker label',
  12. },
  13. className: 'class-for-user-picker',
  14. };
  15. describe('PickerOption', () => {
  16. it('renders correctly', () => {
  17. const tree = renderer.create(<PickerOption {...model} />).toJSON();
  18. expect(tree).toMatchSnapshot();
  19. });
  20. });