From 2fba3b8bfb0e54caa752df6de48780393876d731 Mon Sep 17 00:00:00 2001 From: Ihor Mykhno Date: Fri, 4 Sep 2026 19:32:22 +0200 Subject: [PATCH] feat(scorecard): include aggregation chart display color in scalar aggregation response Signed-off-by: Ihor Mykhno imykhno@redhat.com Assisted-By: Cursor --- .../scorecard/.changeset/hungry-walls-burn.md | 7 ++ .../mockAggregatedMetricResult.ts | 1 + .../src/constants/aggregationKPIs.ts | 25 +++++ .../strategies/ScalarAggregationStrategy.ts | 18 +++- .../WeightedStatusScoreAggregationStrategy.ts | 36 ++----- .../scalarAggregationStrategy.test.ts | 71 +++++++++++++- ...htedStatusScoreAggregationStrategy.test.ts | 34 +++++++ .../src/service/mappers.test.ts | 2 + .../src/service/router.test.ts | 3 +- .../getAggregationChartDisplayColor.test.ts | 94 +++++++++++++++++++ .../getAggregationChartDisplayColor.ts | 53 +++++++++++ .../plugins/scorecard-common/report.api.md | 3 +- .../scorecard-common/src/types/aggregation.ts | 3 +- .../WeightedStatusScoreCardComponent.tsx | 7 +- .../__tests__/ScorecardHomepageCard.test.tsx | 1 + 15 files changed, 318 insertions(+), 40 deletions(-) create mode 100644 workspaces/scorecard/.changeset/hungry-walls-burn.md create mode 100644 workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.test.ts create mode 100644 workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.ts diff --git a/workspaces/scorecard/.changeset/hungry-walls-burn.md b/workspaces/scorecard/.changeset/hungry-walls-burn.md new file mode 100644 index 00000000000..33e4518142d --- /dev/null +++ b/workspaces/scorecard/.changeset/hungry-walls-burn.md @@ -0,0 +1,7 @@ +--- +'@red-hat-developer-hub/backstage-plugin-scorecard': patch +'@red-hat-developer-hub/backstage-plugin-scorecard-backend': patch +'@red-hat-developer-hub/backstage-plugin-scorecard-common': patch +--- + +Skip scalar aggregation threshold coloring when no successful samples contributed (`total` is 0); return a null display color and keep the card grey fallback. diff --git a/workspaces/scorecard/plugins/scorecard-backend/__fixtures__/mockAggregatedMetricResult.ts b/workspaces/scorecard/plugins/scorecard-backend/__fixtures__/mockAggregatedMetricResult.ts index 2b80e44b821..50ce0ea99d9 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/__fixtures__/mockAggregatedMetricResult.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/__fixtures__/mockAggregatedMetricResult.ts @@ -53,6 +53,7 @@ export const mockScalarAggregationResult: ScalarAggregationResult = { timestamp: '2025-01-01T10:30:00.000Z', entitiesConsidered: 2, calculationErrorCount: 0, + aggregationChartDisplayColor: 'warning.main', }; export const mockWeightedStatusScoreAggregationResult: WeightedStatusScoreAggregationResult = diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/constants/aggregationKPIs.ts b/workspaces/scorecard/plugins/scorecard-backend/src/constants/aggregationKPIs.ts index 1c1961a348b..be86dfd5075 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/src/constants/aggregationKPIs.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/src/constants/aggregationKPIs.ts @@ -46,3 +46,28 @@ export const DEFAULT_WEIGHTED_STATUS_SCORE_KPI_RESULT_THRESHOLDS: ThresholdConfi }, ], }; + +/** + * Default applied by `ScalarAggregationStrategy` when `options.thresholds` is omitted + * from app-config. Higher value = better. Evaluated in order; first match wins. + */ +export const DEFAULT_SCALAR_AGGREGATION_KPI_RESULT_THRESHOLDS: ThresholdConfig = + { + rules: [ + { + key: 'success', + expression: '<10', + color: ScorecardThresholdRuleColors.SUCCESS, + }, + { + key: 'warning', + expression: '10-50', + color: ScorecardThresholdRuleColors.WARNING, + }, + { + key: 'error', + expression: '>50', + color: ScorecardThresholdRuleColors.ERROR, + }, + ], + }; diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/ScalarAggregationStrategy.ts b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/ScalarAggregationStrategy.ts index cf02b76297e..0f24c1970a0 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/ScalarAggregationStrategy.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/ScalarAggregationStrategy.ts @@ -31,6 +31,8 @@ import type { AggregationStrategy } from './types'; import { isScalarAggregationConfig } from '../../../utils/aggregation/isScalarAggregationConfig'; import { classifyNumberAgainstThresholds } from '../../../utils/aggregation/classifyNumberAgainstThresholds'; import { ThresholdEvaluator } from '../../../threshold/ThresholdEvaluator'; +import { getRequiredAggregationChartDisplayColor } from '../../../utils/aggregation/getAggregationChartDisplayColor'; +import { DEFAULT_SCALAR_AGGREGATION_KPI_RESULT_THRESHOLDS } from '../../../constants'; export class ScalarAggregationStrategy implements AggregationStrategy { constructor( @@ -50,8 +52,7 @@ export class ScalarAggregationStrategy implements AggregationStrategy { ); } - const { thresholds: headlineThresholds = DEFAULT_NUMBER_THRESHOLDS } = - aggregationConfig.options ?? {}; + const { thresholds: headlineThresholds } = aggregationConfig.options ?? {}; const { value, @@ -66,13 +67,24 @@ export class ScalarAggregationStrategy implements AggregationStrategy { aggregationConfig.filter, ); + const aggregationChartDisplayColor = + total > 0 + ? getRequiredAggregationChartDisplayColor( + value, + headlineThresholds ?? + DEFAULT_SCALAR_AGGREGATION_KPI_RESULT_THRESHOLDS, + `The color for value '${value}' metric '${metric.id}' is not configured. Check the 'scorecard.aggregationKPIs.${aggregationConfig.id}.options.thresholds' configuration.`, + ) + : null; + const result = { value, total, entitiesConsidered, calculationErrorCount, timestamp, - thresholds: headlineThresholds, + aggregationChartDisplayColor, + thresholds: headlineThresholds ?? DEFAULT_NUMBER_THRESHOLDS, } satisfies ScalarAggregationResult; return AggregatedMetricMapper.toAggregatedMetricResult( diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/WeightedStatusScoreAggregationStrategy.ts b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/WeightedStatusScoreAggregationStrategy.ts index 64a53f663fa..f03c5b9c2b4 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/WeightedStatusScoreAggregationStrategy.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/WeightedStatusScoreAggregationStrategy.ts @@ -18,7 +18,6 @@ import { type AggregatedMetric, type WeightedStatusScoreAggregationResult, type AggregatedMetricResult, - type ThresholdConfig, ThresholdRule, aggregationTypes, type StatusScoreAggregationOption, @@ -29,7 +28,7 @@ import type { AggregatedMetricLoader } from '../AggregatedMetricLoader'; import type { AggregationOptions } from '../types'; import type { AggregationStrategy } from './types'; import { LoggerService } from '@backstage/backend-plugin-api'; -import { ThresholdEvaluator } from '../../../threshold/ThresholdEvaluator'; +import { getRequiredAggregationChartDisplayColor } from '../../../utils/aggregation/getAggregationChartDisplayColor'; export class WeightedStatusScoreAggregationStrategy implements AggregationStrategy @@ -77,16 +76,14 @@ export class WeightedStatusScoreAggregationStrategy weightedSum, ); - const aggregationChartDisplayColor = this.getAggregationChartDisplayColor( - weightedStatusScore, - headlineThresholds, - ); - - if (!aggregationChartDisplayColor) { - throw new Error( - `The color for percentage '${weightedStatusScore}' metric '${metric.id}' is not configured. Check the 'scorecard.aggregationKPIs.${aggregationConfig.id}.options.thresholds' configuration.`, - ); - } + const aggregationChartDisplayColor = + aggregatedMetric.total > 0 + ? getRequiredAggregationChartDisplayColor( + weightedStatusScore, + headlineThresholds, + `The color for percentage '${weightedStatusScore}' metric '${metric.id}' is not configured. Check the 'scorecard.aggregationKPIs.${aggregationConfig.id}.options.thresholds' configuration.`, + ) + : null; const result = { total: aggregatedMetric.total, @@ -131,21 +128,6 @@ export class WeightedStatusScoreAggregationStrategy return weightedSum; } - private getAggregationChartDisplayColor( - scorePercent: number, - thresholds: ThresholdConfig, - ): string | undefined { - const thresholdEvaluator = new ThresholdEvaluator(); - - const matchedThresholdKey = thresholdEvaluator.getFirstMatchingThreshold( - scorePercent, - 'number', - thresholds, - ); - - return thresholds.rules.find(r => r.key === matchedThresholdKey)?.color; - } - private prepareWeightedStatusScoreValues( numberOfEntities: Pick['total'], statusScores: StatusScoreAggregationOption, diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/scalarAggregationStrategy.test.ts b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/scalarAggregationStrategy.test.ts index fece891807a..6e59a405142 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/scalarAggregationStrategy.test.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/scalarAggregationStrategy.test.ts @@ -129,7 +129,11 @@ describe('ScalarAggregationStrategy', () => { expect(spyMethods.toAggregatedMetricResultSpy).toHaveBeenCalledWith( metric, - { ...loadedScalarMetric, thresholds: DEFAULT_NUMBER_THRESHOLDS }, + { + ...loadedScalarMetric, + thresholds: DEFAULT_NUMBER_THRESHOLDS, + aggregationChartDisplayColor: 'error.main', + }, defaultAggregationConfig, ); }); @@ -144,7 +148,64 @@ describe('ScalarAggregationStrategy', () => { expect(spyMethods.toAggregatedMetricResultSpy).toHaveBeenCalledWith( metric, - { ...loadedScalarMetric, thresholds: mockHigherIsBetterThresholds }, + { + ...loadedScalarMetric, + thresholds: mockHigherIsBetterThresholds, + aggregationChartDisplayColor: 'green', + }, + aggregationConfig, + ); + }); + + it('should throw when aggregation chart display color is not configured', async () => { + const aggregationConfigWithoutColors = mockScalarAggregationConfig( + aggregationTypes.sum, + { + id: 'totalOpenPrs', + metricId: metric.id, + options: { + thresholds: { + rules: [{ key: 'success', expression: '<10' }], + }, + }, + }, + ); + + await expect(() => + strategy.aggregate({ + metric, + entityRefs, + thresholds: mockHigherIsBetterThresholds, + aggregationConfig: aggregationConfigWithoutColors, + }), + ).rejects.toThrow( + `The color for value '${loadedScalarMetric.value}' metric '${metric.id}' is not configured. Check the 'scorecard.aggregationKPIs.totalOpenPrs.options.thresholds' configuration.`, + ); + }); + + it('should set aggregationChartDisplayColor to null when total is 0', async () => { + (loader.loadScalarMetricByEntityRefs as jest.Mock).mockResolvedValueOnce({ + ...loadedScalarMetric, + value: 0, + total: 0, + }); + + await strategy.aggregate({ + metric, + entityRefs, + thresholds: mockHigherIsBetterThresholds, + aggregationConfig, + }); + + expect(spyMethods.toAggregatedMetricResultSpy).toHaveBeenCalledWith( + metric, + { + ...loadedScalarMetric, + value: 0, + total: 0, + thresholds: mockHigherIsBetterThresholds, + aggregationChartDisplayColor: null, + }, aggregationConfig, ); }); @@ -200,7 +261,11 @@ describe('ScalarAggregationStrategy', () => { expect(spyMethods.toAggregatedMetricResultSpy).toHaveBeenCalledWith( metric, - { ...loadedScalarMetric, thresholds: mockHigherIsBetterThresholds }, + { + ...loadedScalarMetric, + thresholds: mockHigherIsBetterThresholds, + aggregationChartDisplayColor: 'green', + }, aggregationConfig, ); }); diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/weightedStatusScoreAggregationStrategy.test.ts b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/weightedStatusScoreAggregationStrategy.test.ts index 4440f091d92..49c82f62f56 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/weightedStatusScoreAggregationStrategy.test.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/src/service/aggregations/strategies/weightedStatusScoreAggregationStrategy.test.ts @@ -193,6 +193,40 @@ describe('WeightedStatusScoreAggregationStrategy', () => { ); }); + it('should set aggregationChartDisplayColor to null when total is 0', async () => { + ( + loader.loadStatusGroupedMetricByEntityRefs as jest.Mock + ).mockResolvedValueOnce({ + ...loadedStatusGroupedMetric, + values: {}, + total: 0, + }); + + await strategy.aggregate({ + metric, + entityRefs, + thresholds: mockHigherIsBetterThresholds, + aggregationConfig, + }); + + expect(spyMethods.toAggregatedMetricResultSpy).toHaveBeenCalledWith( + metric, + { + ...mappedWeightedResult, + values: [ + { name: 'success', count: 0, score: 100 }, + { name: 'error', count: 0, score: 0 }, + ], + weightedStatusScore: 0, + weightedStatusSum: 0, + weightedStatusMaxPossible: 0, + aggregationChartDisplayColor: null, + total: 0, + }, + aggregationConfig, + ); + }); + it('should get aggregation result', async () => { const result = await strategy.aggregate({ metric, diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/service/mappers.test.ts b/workspaces/scorecard/plugins/scorecard-backend/src/service/mappers.test.ts index 25d93d4a56f..1fe8ce425fe 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/src/service/mappers.test.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/src/service/mappers.test.ts @@ -348,6 +348,7 @@ describe('AggregatedMetricMapper', () => { calculationErrorCount: 1, timestamp: '2024-01-15T10:00:00.000Z', thresholds, + aggregationChartDisplayColor: 'warning.main', }, aggregationConfig, ); @@ -369,6 +370,7 @@ describe('AggregatedMetricMapper', () => { calculationErrorCount: 1, timestamp: '2024-01-15T10:00:00.000Z', thresholds, + aggregationChartDisplayColor: 'warning.main', }, aggregationConfig, ); diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/service/router.test.ts b/workspaces/scorecard/plugins/scorecard-backend/src/service/router.test.ts index cae23c10960..1dfa37b2035 100644 --- a/workspaces/scorecard/plugins/scorecard-backend/src/service/router.test.ts +++ b/workspaces/scorecard/plugins/scorecard-backend/src/service/router.test.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Config } from '@backstage/config'; +import type { Config } from '@backstage/config'; import { mockErrorHandler, mockServices, @@ -1619,6 +1619,7 @@ describe('createRouter', () => { entitiesConsidered: 45, calculationErrorCount: 3, timestamp: '2025-01-01T10:30:00.000Z', + aggregationChartDisplayColor: 'error.main', thresholds: DEFAULT_NUMBER_THRESHOLDS, }); }); diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.test.ts b/workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.test.ts new file mode 100644 index 00000000000..827b9973aca --- /dev/null +++ b/workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.test.ts @@ -0,0 +1,94 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { + getAggregationChartDisplayColor, + getRequiredAggregationChartDisplayColor, +} from './getAggregationChartDisplayColor'; + +const overlappingThresholds = { + rules: [ + { + key: 'error', + expression: '>50', + color: 'red', + }, + { + key: 'warning', + expression: '12-50', + color: 'yellow', + }, + { + key: 'success', + expression: '<13', + color: 'green', + }, + ], +}; + +describe('getAggregationChartDisplayColor', () => { + it('should return undefined when no rule matches', () => { + expect( + getAggregationChartDisplayColor(50, { + rules: [{ key: 'success', expression: '<10', color: 'green' }], + }), + ).toBeUndefined(); + }); + + it('should return undefined when the matching rule has no color', () => { + expect( + getAggregationChartDisplayColor(5, { + rules: [{ key: 'success', expression: '<10' }], + }), + ).toBeUndefined(); + }); + + it('should return the color of the first matching rule', () => { + expect(getAggregationChartDisplayColor(12, overlappingThresholds)).toBe( + 'yellow', + ); + }); + + it('should follow rule order when multiple expressions match', () => { + expect( + getAggregationChartDisplayColor(12, { + rules: [...overlappingThresholds.rules].reverse(), + }), + ).toBe('green'); + }); +}); + +describe('getRequiredAggregationChartDisplayColor', () => { + it('should throw the given error when no color matches', () => { + expect(() => + getRequiredAggregationChartDisplayColor( + 50, + { rules: [{ key: 'success', expression: '<10', color: 'green' }] }, + 'color is not configured', + ), + ).toThrow('color is not configured'); + }); + + it('should return the matching color', () => { + expect( + getRequiredAggregationChartDisplayColor( + 12, + overlappingThresholds, + 'color is not configured', + ), + ).toBe('yellow'); + }); +}); diff --git a/workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.ts b/workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.ts new file mode 100644 index 00000000000..535cb3c5adf --- /dev/null +++ b/workspaces/scorecard/plugins/scorecard-backend/src/utils/aggregation/getAggregationChartDisplayColor.ts @@ -0,0 +1,53 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { ThresholdConfig } from '@red-hat-developer-hub/backstage-plugin-scorecard-common'; +import { ThresholdEvaluator } from '../../threshold/ThresholdEvaluator'; + +/** + * Get the aggregation chart display color for a given value and thresholds. + * @param value - The value to get the color for. + * @param thresholds - The thresholds to use. + * @returns The aggregation chart display color. + */ +export function getAggregationChartDisplayColor( + value: number, + thresholds: ThresholdConfig, +): string | undefined { + const thresholdEvaluator = new ThresholdEvaluator(); + + const matchedThresholdKey = thresholdEvaluator.getFirstMatchingThreshold( + value, + 'number', + thresholds, + ); + + return thresholds.rules.find(r => r.key === matchedThresholdKey)?.color; +} + +export function getRequiredAggregationChartDisplayColor( + value: number, + thresholds: ThresholdConfig, + errorMessage: string, +): string { + const color = getAggregationChartDisplayColor(value, thresholds); + + if (!color) { + throw new Error(errorMessage); + } + + return color; +} diff --git a/workspaces/scorecard/plugins/scorecard-common/report.api.md b/workspaces/scorecard/plugins/scorecard-common/report.api.md index a655b08089a..6a3ca5d009b 100644 --- a/workspaces/scorecard/plugins/scorecard-common/report.api.md +++ b/workspaces/scorecard/plugins/scorecard-common/report.api.md @@ -241,6 +241,7 @@ export type ScalarAggregatedTimeSeriesPoint = { // @public (undocumented) export type ScalarAggregationResult = ScalarAggregatedMetric & { thresholds: ThresholdConfig; + aggregationChartDisplayColor: string | null; }; // @public @@ -339,7 +340,7 @@ export type WeightedStatusScoreAggregationResult = weightedStatusScore: number; weightedStatusSum: number; weightedStatusMaxPossible: number; - aggregationChartDisplayColor: string; + aggregationChartDisplayColor: string | null; }; // (No @packageDocumentation comment for this package) diff --git a/workspaces/scorecard/plugins/scorecard-common/src/types/aggregation.ts b/workspaces/scorecard/plugins/scorecard-common/src/types/aggregation.ts index a7008994afa..21d05c7cc3a 100644 --- a/workspaces/scorecard/plugins/scorecard-common/src/types/aggregation.ts +++ b/workspaces/scorecard/plugins/scorecard-common/src/types/aggregation.ts @@ -100,7 +100,7 @@ export type WeightedStatusScoreAggregationResult = weightedStatusScore: number; weightedStatusSum: number; weightedStatusMaxPossible: number; - aggregationChartDisplayColor: string; + aggregationChartDisplayColor: string | null; }; /** @@ -108,6 +108,7 @@ export type WeightedStatusScoreAggregationResult = */ export type ScalarAggregationResult = ScalarAggregatedMetric & { thresholds: ThresholdConfig; + aggregationChartDisplayColor: string | null; }; /** diff --git a/workspaces/scorecard/plugins/scorecard/src/components/AggregatedMetricCards/WeightedStatusScoreCard/WeightedStatusScoreCardComponent.tsx b/workspaces/scorecard/plugins/scorecard/src/components/AggregatedMetricCards/WeightedStatusScoreCard/WeightedStatusScoreCardComponent.tsx index 9bf0d0d09e2..06bbffd23a9 100644 --- a/workspaces/scorecard/plugins/scorecard/src/components/AggregatedMetricCards/WeightedStatusScoreCard/WeightedStatusScoreCardComponent.tsx +++ b/workspaces/scorecard/plugins/scorecard/src/components/AggregatedMetricCards/WeightedStatusScoreCard/WeightedStatusScoreCardComponent.tsx @@ -73,10 +73,9 @@ export const WeightedStatusScoreCardComponent = ({ const centerPercentLabel = `${formatPercentage(weightedStatusScorePercent)}%`; - const arcResolvedColor = resolveStatusColor( - theme, - scorecard.result.aggregationChartDisplayColor, - ); + const arcResolvedColor = scorecard.result.aggregationChartDisplayColor + ? resolveStatusColor(theme, scorecard.result.aggregationChartDisplayColor) + : theme.palette.grey[300]; const weightedStatusScorePieData: PieData[] = [ { diff --git a/workspaces/scorecard/plugins/scorecard/src/components/ScorecardHomepageSection/__tests__/ScorecardHomepageCard.test.tsx b/workspaces/scorecard/plugins/scorecard/src/components/ScorecardHomepageSection/__tests__/ScorecardHomepageCard.test.tsx index 34c71fb6f3f..6fc46a65f56 100644 --- a/workspaces/scorecard/plugins/scorecard/src/components/ScorecardHomepageSection/__tests__/ScorecardHomepageCard.test.tsx +++ b/workspaces/scorecard/plugins/scorecard/src/components/ScorecardHomepageSection/__tests__/ScorecardHomepageCard.test.tsx @@ -228,6 +228,7 @@ const mockScalarAggregationScorecard: AggregatedMetricResult = { thresholds: DEFAULT_NUMBER_THRESHOLDS, entitiesConsidered: 4, calculationErrorCount: 0, + aggregationChartDisplayColor: 'warning.main', }, };