mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
27 lines
527 B
TypeScript
27 lines
527 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { FormField, Props } from './FormField';
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
const props: Props = {
|
|
label: 'Test',
|
|
labelWidth: 11,
|
|
inputProps: {
|
|
value: 10,
|
|
onChange: jest.fn(),
|
|
},
|
|
};
|
|
|
|
Object.assign(props, propOverrides);
|
|
|
|
return shallow(<FormField {...props} />);
|
|
};
|
|
|
|
describe('Render', () => {
|
|
it('should render component', () => {
|
|
const wrapper = setup();
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|