mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
33 lines
673 B
TypeScript
33 lines
673 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import ButtonRow, { Props } from './ButtonRow';
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
const props: Props = {
|
|
isReadOnly: true,
|
|
onSubmit: jest.fn(),
|
|
onDelete: jest.fn(),
|
|
onTest: jest.fn(),
|
|
};
|
|
|
|
Object.assign(props, propOverrides);
|
|
|
|
return shallow(<ButtonRow {...props} />);
|
|
};
|
|
|
|
describe('Render', () => {
|
|
it('should render component', () => {
|
|
const wrapper = setup();
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
|
|
it('should render with buttons enabled', () => {
|
|
const wrapper = setup({
|
|
isReadOnly: false,
|
|
});
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|