Fix tests: Handle undefined config.unifiedAlerting in tests
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ import { Button, Stack } from '@grafana/ui';
|
||||
|
||||
import { formatPrometheusDuration, parsePrometheusDuration, safeParsePrometheusDuration } from '../../utils/time';
|
||||
|
||||
const MIN_INTERVAl = config.unifiedAlerting.minInterval ?? '10s';
|
||||
const MIN_INTERVAl = config.unifiedAlerting?.minInterval ?? '10s';
|
||||
export const getEvaluationGroupOptions = (minInterval = MIN_INTERVAl) => {
|
||||
const MIN_OPTIONS_TO_SHOW = 8;
|
||||
const DEFAULT_INTERVAL_OPTIONS: number[] = [
|
||||
|
||||
@@ -48,6 +48,9 @@ jest.mock('@grafana/runtime', () => ({
|
||||
featureToggles: {
|
||||
newVariables: false,
|
||||
},
|
||||
unifiedAlerting: {
|
||||
minInterval: '10s',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ jest.mock('@grafana/runtime', () => ({
|
||||
featureToggles: {
|
||||
newVariables: false,
|
||||
},
|
||||
unifiedAlerting: {
|
||||
minInterval: '10s',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
@@ -42,6 +42,9 @@ jest.mock('@grafana/runtime', () => ({
|
||||
},
|
||||
},
|
||||
},
|
||||
unifiedAlerting: {
|
||||
minInterval: '10s',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user