Files
grafana/public/app/plugins/datasource/azuremonitor/components/ConfigEditor.test.tsx
Andreas Christou d7f7cd1e61 Schema: Initial Azure Monitor query schema (#62018)
* Initial schema

- Add types based off of current frontend

* Rename and field-level comments

* Update report and regenerate files

* Rename frontend Azure folder

- Doing this for consistency and to ensure code-generation works
- Update betterer results due to file renames

* Remove default and add back enum vals that I deleted

* Set workspace prop as optional

* Replace template variable types

* Connect frontend query types

- Keep properties optional for now to avoid major changes
- Rename AzureMetricResource
- Correctly use ResultFormat

* Add TSVeneer decorator

* Update schema

* Update type

* Update CODEOWNERS

* Fix gen-cue issue

* Fix backend test

* Fix e2e test

* Update code coverage

* Remove references to old Azure Monitor path

* Review

* Regen files
2023-02-03 16:06:54 +00:00

47 lines
1.1 KiB
TypeScript

import { render, screen } from '@testing-library/react';
import React from 'react';
import ConfigEditor from './ConfigEditor';
describe('AppInsights ConfigEditor', () => {
const baseOptions = {
id: 21,
uid: 'y',
orgId: 1,
name: 'Azure Monitor-10-10',
type: 'grafana-azure-monitor-datasource',
typeLogoUrl: '',
typeName: 'Azure',
access: 'proxy',
url: '',
user: '',
database: '',
basicAuth: false,
basicAuthUser: '',
withCredentials: false,
isDefault: false,
jsonData: {},
secureJsonFields: {},
version: 1,
readOnly: false,
};
const jsonData = {
subscriptionId: '44987801-6nn6-49he-9b2d-9106972f9789',
azureLogAnalyticsSameAs: true,
cloudName: 'azuremonitor',
};
const onOptionsChange = jest.fn();
it('should not render application insights config for new data sources', () => {
const options = {
...baseOptions,
jsonData,
};
render(<ConfigEditor options={options} onOptionsChange={onOptionsChange} />);
expect(screen.queryByText('Azure Application Insights')).not.toBeInTheDocument();
});
});