Files
grafana/public/app/core/components/Picker/PickerOption.test.tsx
2018-10-10 14:15:25 +02:00

25 lines
582 B
TypeScript

import React from 'react';
import renderer from 'react-test-renderer';
import PickerOption from './PickerOption';
const model = {
cx: jest.fn(),
clearValue: jest.fn(),
onSelect: jest.fn(),
getStyles: jest.fn(),
children: 'Model title',
data: {
title: 'Model title',
avatarUrl: 'url/to/avatar',
label: 'User picker label',
},
className: 'class-for-user-picker',
};
describe('PickerOption', () => {
it('renders correctly', () => {
const tree = renderer.create(<PickerOption {...model} />).toJSON();
expect(tree).toMatchSnapshot();
});
});