Fix tests: Handle undefined config.unifiedAlerting in tests

This commit is contained in:
laurenashleigh
2026-01-12 11:46:45 +00:00
parent b353a20053
commit a62aa4f6a2
4 changed files with 10 additions and 1 deletions
@@ -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',
},
},
}));