mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix tests to not expect default threshold
This commit is contained in:
parent
8503c86275
commit
4e680d91bd
@ -350,7 +350,7 @@ export function setFieldConfigDefaults(config: FieldConfig, defaults: FieldConfi
|
|||||||
|
|
||||||
// if we have a base threshold set by default but not on the config, we need to merge it in
|
// if we have a base threshold set by default but not on the config, we need to merge it in
|
||||||
const defaultBaseStep =
|
const defaultBaseStep =
|
||||||
defaults.thresholds?.mode === ThresholdsMode.Absolute &&
|
defaults?.thresholds?.mode === ThresholdsMode.Absolute &&
|
||||||
defaults.thresholds?.steps.find((step) => step.value === -Infinity);
|
defaults.thresholds?.steps.find((step) => step.value === -Infinity);
|
||||||
if (
|
if (
|
||||||
config.thresholds?.mode === ThresholdsMode.Absolute &&
|
config.thresholds?.mode === ThresholdsMode.Absolute &&
|
||||||
|
@ -93,7 +93,7 @@ describe('config from data', () => {
|
|||||||
|
|
||||||
const results = extractConfigFromQuery(options, [config, seriesA]);
|
const results = extractConfigFromQuery(options, [config, seriesA]);
|
||||||
expect(results.length).toBe(1);
|
expect(results.length).toBe(1);
|
||||||
const thresholdConfig = results[0].fields[1].config.thresholds?.steps[1];
|
const thresholdConfig = results[0].fields[1].config.thresholds?.steps[0];
|
||||||
expect(thresholdConfig).toBeDefined();
|
expect(thresholdConfig).toBeDefined();
|
||||||
expect(thresholdConfig?.color).toBe('orange');
|
expect(thresholdConfig?.color).toBe('orange');
|
||||||
expect(thresholdConfig?.value).toBe(50);
|
expect(thresholdConfig?.value).toBe(50);
|
||||||
|
@ -111,7 +111,7 @@ describe('Rows to fields', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const result = rowsToFields({}, input);
|
const result = rowsToFields({}, input);
|
||||||
expect(result.fields[0].config.thresholds?.steps[1].value).toBe(30);
|
expect(result.fields[0].config.thresholds?.steps[0].value).toBe(30);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Will extract other string fields to labels', () => {
|
it('Will extract other string fields to labels', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user