ConfigEditor.test.tsx 952 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import ConfigEditor, { Props } from './ConfigEditor';
  4. const setup = () => {
  5. const props: Props = {
  6. options: {
  7. id: 21,
  8. orgId: 1,
  9. name: 'Azure Monitor-10-10',
  10. type: 'grafana-azure-monitor-datasource',
  11. typeLogoUrl: '',
  12. access: 'proxy',
  13. url: '',
  14. password: '',
  15. user: '',
  16. database: '',
  17. basicAuth: false,
  18. basicAuthUser: '',
  19. basicAuthPassword: '',
  20. withCredentials: false,
  21. isDefault: false,
  22. jsonData: {
  23. azureLogAnalyticsSameAs: true,
  24. cloudName: 'azuremonitor',
  25. },
  26. secureJsonFields: {},
  27. version: 1,
  28. readOnly: false,
  29. },
  30. onOptionsChange: jest.fn(),
  31. };
  32. return shallow(<ConfigEditor {...props} />);
  33. };
  34. describe('Render', () => {
  35. it('should render component', () => {
  36. const wrapper = setup();
  37. expect(wrapper).toMatchSnapshot();
  38. });
  39. });