The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/alerting/unified/utils/datasource.test.ts

39 lines
829 B

import { mockDataSource } from '../mocks';
import { isDataSourceManagingAlerts } from './datasource';
describe('isDataSourceManagingAlerts', () => {
it('should return true when the prop is set as true', () => {
expect(
isDataSourceManagingAlerts(
mockDataSource({
jsonData: {
manageAlerts: true,
},
})
)
).toBe(true);
});
it('should return true when the prop is undefined', () => {
expect(
isDataSourceManagingAlerts(
mockDataSource({
jsonData: {},
})
)
).toBe(true);
});
});
it('should return false when the prop is set as false', () => {
expect(
isDataSourceManagingAlerts(
mockDataSource({
jsonData: {
manageAlerts: false,
},
})
)
).toBe(false);
});