mirror of https://github.com/grafana/grafana
Alerting: Remove the alert manager selection from the data source configuration (#57369)
* Remove alertmanager dropdown from datasource config * Avoid sending alertmanagers from loki/prom config editors * Add test * Remove unneeded parampull/57616/head
parent
a63c529ad1
commit
9eae793b5d
@ -0,0 +1,51 @@ |
||||
import { render, screen } from '@testing-library/react'; |
||||
import React from 'react'; |
||||
|
||||
import { AlertingSettings } from '@grafana/ui'; |
||||
|
||||
import { Props, AlertingConfig } from './AlertingSettings'; |
||||
|
||||
const setup = () => { |
||||
const onOptionsChange = jest.fn(); |
||||
const props: Props<AlertingConfig> = { |
||||
options: { |
||||
id: 4, |
||||
uid: 'x', |
||||
orgId: 1, |
||||
name: 'test', |
||||
type: 'test', |
||||
typeName: 'test', |
||||
typeLogoUrl: '', |
||||
access: 'direct', |
||||
url: 'http://localhost:8086', |
||||
user: 'grafana', |
||||
database: 'site', |
||||
basicAuth: false, |
||||
basicAuthUser: '', |
||||
withCredentials: false, |
||||
isDefault: false, |
||||
jsonData: {}, |
||||
secureJsonData: { |
||||
password: true, |
||||
}, |
||||
secureJsonFields: {}, |
||||
readOnly: true, |
||||
}, |
||||
onOptionsChange, |
||||
}; |
||||
|
||||
render(<AlertingSettings {...props} />); |
||||
}; |
||||
|
||||
describe('Alerting Settings', () => { |
||||
//see https://github.com/grafana/grafana/issues/51417
|
||||
it('should not show the option to select alertmanager data sources', () => { |
||||
setup(); |
||||
expect(screen.queryByText('Alertmanager data source')).toBeNull(); |
||||
}); |
||||
|
||||
it('should show the option to Manage alerts via Alerting UI', () => { |
||||
setup(); |
||||
expect(screen.getByText('Manage alerts via Alerting UI')).toBeVisible(); |
||||
}); |
||||
}); |
Loading…
Reference in new issue