SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
chore: updated config builder types (#10477)
Abhi kumar5af6ed6148c0
diff --git a/frontend/src/container/DashboardContainer/visualization/panels/BarPanel/utils.ts b/frontend/src/container/DashboardContainer/visualization/panels/BarPanel/utils.tsindex 25ffc1779f..5c1de115c7 100644--- a/frontend/src/container/DashboardContainer/visualization/panels/BarPanel/utils.ts+++ b/frontend/src/container/DashboardContainer/visualization/panels/BarPanel/utils.ts@@ -58,7 +58,7 @@ export function prepareBarPanelConfig({const minStepInterval = Math.min(...Object.values(stepIntervals));const builder = buildBaseConfig({- widgetId: widget.id,+ id: widget.id,thresholds: widget.thresholds,yAxisUnit: widget.yAxisUnit,softMin: widget.softMin ?? undefined,diff --git a/frontend/src/container/DashboardContainer/visualization/panels/HistogramPanel/utils.ts b/frontend/src/container/DashboardContainer/visualization/panels/HistogramPanel/utils.tsindex a966c52604..1fcd67cb35 100644--- a/frontend/src/container/DashboardContainer/visualization/panels/HistogramPanel/utils.ts+++ b/frontend/src/container/DashboardContainer/visualization/panels/HistogramPanel/utils.ts@@ -154,7 +154,7 @@ export function prepareHistogramPanelConfig({isDarkMode: boolean;}): UPlotConfigBuilder {const builder = buildBaseConfig({- widgetId: widget.id,+ id: widget.id,thresholds: widget.thresholds,yAxisUnit: widget.yAxisUnit,softMin: widget.softMin ?? undefined,diff --git a/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.ts b/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.tsindex 643fd2f4f1..9f3a52841f 100644--- a/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.ts+++ b/frontend/src/container/DashboardContainer/visualization/panels/TimeSeriesPanel/utils.ts@@ -82,7 +82,7 @@ export const prepareUPlotConfig = ({const minStepInterval = Math.min(...Object.values(stepIntervals));const builder = buildBaseConfig({- widgetId: widget.id,+ id: widget.id,thresholds: widget.thresholds,yAxisUnit: widget.yAxisUnit,softMin: widget.softMin ?? undefined,diff --git a/frontend/src/container/DashboardContainer/visualization/panels/utils/__tests__/baseConfigBuilder.test.ts b/frontend/src/container/DashboardContainer/visualization/panels/utils/__tests__/baseConfigBuilder.test.tsindex a93ff3ae6d..4308b4fce1 100644--- a/frontend/src/container/DashboardContainer/visualization/panels/utils/__tests__/baseConfigBuilder.test.ts+++ b/frontend/src/container/DashboardContainer/visualization/panels/utils/__tests__/baseConfigBuilder.test.ts@@ -28,9 +28,17 @@ jest.mock('lib/uPlotLib/plugins/onClickPlugin', () => ({}));const createBaseConfigBuilderProps = (- overrides: Partial<BaseConfigBuilderProps> = {},-): Partial<BaseConfigBuilderProps> => ({- widgetId: 'widget-1',+ overrides: Partial<+ Pick<+ BaseConfigBuilderProps,+ 'id' | 'yAxisUnit' | 'isLogScale' | 'softMin' | 'softMax' | 'thresholds'+ >+ > = {},+): Pick<+ BaseConfigBuilderProps,+ 'id' | 'yAxisUnit' | 'isLogScale' | 'softMin' | 'softMax' | 'thresholds'+> => ({+ id: 'widget-1',yAxisUnit: 'ms',isLogScale: false,softMin: undefined,@@ -64,14 +72,14 @@ describe('buildBaseConfig', () => {expect(typeof builder.getLegendItems).toBe('function');});- it('configures builder with widgetId and DASHBOARD_VIEW preferences', () => {+ it('configures builder with id and DASHBOARD_VIEW preferences', () => {const builder = buildBaseConfig({...baseProps,panelMode: PanelMode.DASHBOARD_VIEW,- ...createBaseConfigBuilderProps({ widgetId: 'my-widget' }),+ ...createBaseConfigBuilderProps({ id: 'my-widget' }),});- expect(builder.getWidgetId()).toBe('my-widget');+ expect(builder.getId()).toBe('my-widget');expect(builder.getShouldSaveSelectionPreference()).toBe(true);});diff --git a/frontend/src/container/DashboardContainer/visualization/panels/utils/baseConfigBuilder.ts b/frontend/src/container/DashboardContainer/visualization/panels/utils/baseConfigBuilder.tsindex 45c1c65c1c..e9e4468444 100644--- a/frontend/src/container/DashboardContainer/visualization/panels/utils/baseConfigBuilder.ts+++ b/frontend/src/container/DashboardContainer/visualization/panels/utils/baseConfigBuilder.ts@@ -16,7 +16,7 @@ import uPlot from 'uplot';import { PanelMode } from '../types';export interface BaseConfigBuilderProps {- widgetId?: string;+ id: string;thresholds?: ThresholdProps[];apiResponse: MetricRangePayloadProps;isDarkMode: boolean;@@ -35,7 +35,7 @@ export interface BaseConfigBuilderProps {}export function buildBaseConfig({- widgetId,+ id,isDarkMode,onClick,onDragSelect,@@ -58,8 +58,8 @@ export function buildBaseConfig({: undefined;const builder = new UPlotConfigBuilder({+ id,onDragSelect,- widgetId: widgetId,tzDate,shouldSaveSelectionPreference: panelMode === PanelMode.DASHBOARD_VIEW,selectionPreferencesSource: panelMode@@ -123,7 +123,7 @@ export function buildBaseConfig({show: true,side: 2,isDarkMode,- isLogScale: isLogScale,+ isLogScale,panelType,});@@ -132,8 +132,8 @@ export function buildBaseConfig({show: true,side: 3,isDarkMode,- isLogScale: isLogScale,- yAxisUnit: yAxisUnit,+ isLogScale,+ yAxisUnit,panelType,});diff --git a/frontend/src/lib/uPlotV2/components/UPlotChart.tsx b/frontend/src/lib/uPlotV2/components/UPlotChart.tsxindex 77b3d9437a..7e6320ea5f 100644--- a/frontend/src/lib/uPlotV2/components/UPlotChart.tsx+++ b/frontend/src/lib/uPlotV2/components/UPlotChart.tsx@@ -92,7 +92,7 @@ export default function UPlotChart({setPlotContextInitialState({uPlotInstance: plot,- widgetId: config.getWidgetId(),+ id: config.getId(),shouldSaveSelectionPreference: config.getShouldSaveSelectionPreference(),});diff --git a/frontend/src/lib/uPlotV2/components/__tests__/UPlotChart.test.tsx b/frontend/src/lib/uPlotV2/components/__tests__/UPlotChart.test.tsxindex dfe7b38ed8..c0908a323a 100644--- a/frontend/src/lib/uPlotV2/components/__tests__/UPlotChart.test.tsx+++ b/frontend/src/lib/uPlotV2/components/__tests__/UPlotChart.test.tsx@@ -84,7 +84,7 @@ const createMockConfig = (): UPlotConfigBuilder => {hooks: {},cursor: {},}),- getWidgetId: jest.fn().mockReturnValue(undefined),+ getId: jest.fn().mockReturnValue(undefined),getShouldSaveSelectionPreference: jest.fn().mockReturnValue(false),} as unknown) as UPlotConfigBuilder;};diff --git a/frontend/src/lib/uPlotV2/config/UPlotConfigBuilder.ts b/frontend/src/lib/uPlotV2/config/UPlotConfigBuilder.tsindex 75487aa05b..ed8f36efdd 100644--- a/frontend/src/lib/uPlotV2/config/UPlotConfigBuilder.ts+++ b/frontend/src/lib/uPlotV2/config/UPlotConfigBuilder.ts@@ -74,23 +74,21 @@ export class UPlotConfigBuilder extends ConfigBuilder<private tzDate: ((timestamp: number) => Date) | undefined;- private widgetId: string | undefined;+ private id: string;private onDragSelect: (startTime: number, endTime: number) => void;- constructor(args?: ConfigBuilderProps) {- super(args ?? {});+ constructor(args: ConfigBuilderProps) {+ super(args);const {- widgetId,+ id,onDragSelect,tzDate,selectionPreferencesSource,shouldSaveSelectionPreference,stepInterval,} = args ?? {};- if (widgetId) {- this.widgetId = widgetId;- }+ this.id = id;if (tzDate) {this.tzDate = tzDate;@@ -252,10 +250,10 @@ export class UPlotConfigBuilder extends ConfigBuilder<*/private getStoredVisibility(): SeriesVisibilityItem[] | null {if (- this.widgetId &&+ this.id &&this.selectionPreferencesSource === SelectionPreferencesSource.LOCAL_STORAGE) {- return getStoredSeriesVisibility(this.widgetId);+ return getStoredSeriesVisibility(this.id);}return null;}@@ -378,10 +376,10 @@ export class UPlotConfigBuilder extends ConfigBuilder<}/**- * Get the widget id+ * Get the id for the builder*/- getWidgetId(): string | undefined {- return this.widgetId;+ getId(): string {+ return this.id;}/**diff --git a/frontend/src/lib/uPlotV2/config/__tests__/UPlotConfigBuilder.test.ts b/frontend/src/lib/uPlotV2/config/__tests__/UPlotConfigBuilder.test.tsindex 939a55f6ff..18517fc68b 100644--- a/frontend/src/lib/uPlotV2/config/__tests__/UPlotConfigBuilder.test.ts+++ b/frontend/src/lib/uPlotV2/config/__tests__/UPlotConfigBuilder.test.ts@@ -47,21 +47,22 @@ describe('UPlotConfigBuilder', () => {it('returns correct save selection preference flag from constructor args', () => {const builder = new UPlotConfigBuilder({+ id: 'widget-123',shouldSaveSelectionPreference: true,});expect(builder.getShouldSaveSelectionPreference()).toBe(true);});- it('returns widgetId from constructor args', () => {- const builder = new UPlotConfigBuilder({ widgetId: 'widget-123' });+ it('returns id from constructor args', () => {+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });- expect(builder.getWidgetId()).toBe('widget-123');+ expect(builder.getId()).toBe('widget-123');});it('sets tzDate from constructor and includes it in config', () => {const tzDate = (ts: number): Date => new Date(ts);- const builder = new UPlotConfigBuilder({ tzDate });+ const builder = new UPlotConfigBuilder({ id: 'widget-123', tzDate });const config = builder.getConfig();@@ -70,7 +71,7 @@ describe('UPlotConfigBuilder', () => {it('does not call onDragSelect for click without drag (width === 0)', () => {const onDragSelect = jest.fn();- const builder = new UPlotConfigBuilder({ onDragSelect });+ const builder = new UPlotConfigBuilder({ id: 'widget-123', onDragSelect });const config = builder.getConfig();const setSelectHooks = config.hooks?.setSelect ?? [];@@ -83,14 +84,15 @@ describe('UPlotConfigBuilder', () => {// Simulate uPlot calling the hookconst setSelectHook = setSelectHooks[0];- setSelectHook!(uplotInstance);+ expect(setSelectHook).toBeDefined();+ setSelectHook?.(uplotInstance);expect(onDragSelect).not.toHaveBeenCalled();});it('calls onDragSelect with start and end times in milliseconds for a drag selection', () => {const onDragSelect = jest.fn();- const builder = new UPlotConfigBuilder({ onDragSelect });+ const builder = new UPlotConfigBuilder({ id: 'widget-123', onDragSelect });const config = builder.getConfig();const setSelectHooks = config.hooks?.setSelect ?? [];@@ -109,7 +111,8 @@ describe('UPlotConfigBuilder', () => {} as unknown) as uPlot;const setSelectHook = setSelectHooks[0];- setSelectHook!(uplotInstance);+ expect(setSelectHook).toBeDefined();+ setSelectHook?.(uplotInstance);expect(onDragSelect).toHaveBeenCalledTimes(1);// 100 and 110 seconds converted to milliseconds@@ -117,7 +120,7 @@ describe('UPlotConfigBuilder', () => {});it('adds and removes hooks via addHook, and exposes them through getConfig', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const drawHook = jest.fn();const remove = builder.addHook('draw', drawHook as uPlot.Hooks.Defs['draw']);@@ -132,7 +135,7 @@ describe('UPlotConfigBuilder', () => {});it('adds axes, scales, and series and wires them into the final config', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });// Add axis and scalebuilder.addAxis({ scaleKey: 'y', label: 'Requests' });@@ -168,7 +171,7 @@ describe('UPlotConfigBuilder', () => {});it('merges axis when addAxis is called twice with same scaleKey', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });builder.addAxis({ scaleKey: 'y', label: 'Requests' });builder.addAxis({ scaleKey: 'y', label: 'Updated Label', show: false });@@ -181,7 +184,7 @@ describe('UPlotConfigBuilder', () => {});it('merges scale when addScale is called twice with same scaleKey', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });builder.addScale({ scaleKey: 'y', min: 0 });builder.addScale({ scaleKey: 'y', max: 100 });@@ -202,7 +205,7 @@ describe('UPlotConfigBuilder', () => {]);const builder = new UPlotConfigBuilder({- widgetId: 'widget-1',+ id: 'widget-1',selectionPreferencesSource: SelectionPreferencesSource.LOCAL_STORAGE,});@@ -229,7 +232,7 @@ describe('UPlotConfigBuilder', () => {]);const builder = new UPlotConfigBuilder({- widgetId: 'widget-1',+ id: 'widget-1',selectionPreferencesSource: SelectionPreferencesSource.LOCAL_STORAGE,});@@ -267,7 +270,7 @@ describe('UPlotConfigBuilder', () => {]);const builder = new UPlotConfigBuilder({- widgetId: 'widget-1',+ id: 'widget-1',selectionPreferencesSource: SelectionPreferencesSource.LOCAL_STORAGE,});@@ -300,7 +303,7 @@ describe('UPlotConfigBuilder', () => {]);const builder = new UPlotConfigBuilder({- widgetId: 'widget-dup',+ id: 'widget-dup',selectionPreferencesSource: SelectionPreferencesSource.LOCAL_STORAGE,});@@ -327,7 +330,7 @@ describe('UPlotConfigBuilder', () => {it('does not attempt to read stored visibility when using in-memory preferences', () => {const builder = new UPlotConfigBuilder({- widgetId: 'widget-1',+ id: 'widget-1',selectionPreferencesSource: SelectionPreferencesSource.IN_MEMORY,});@@ -342,7 +345,7 @@ describe('UPlotConfigBuilder', () => {});it('adds thresholds only once per scale key', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const thresholdsOptions = {scaleKey: 'y',@@ -360,7 +363,7 @@ describe('UPlotConfigBuilder', () => {});it('adds multiple thresholds when scale key is different', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const thresholdsOptions = {scaleKey: 'y',@@ -381,7 +384,7 @@ describe('UPlotConfigBuilder', () => {});it('merges cursor configuration with defaults instead of replacing them', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });builder.setCursor({drag: { setScale: false },@@ -396,7 +399,7 @@ describe('UPlotConfigBuilder', () => {describe('getCursorConfig', () => {it('returns default cursor merged with custom cursor when no stepInterval', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });builder.setCursor({drag: { setScale: false },@@ -410,7 +413,7 @@ describe('UPlotConfigBuilder', () => {});it('returns hover prox as DEFAULT_HOVER_PROXIMITY_VALUE when stepInterval is not set', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const cursorConfig = builder.getCursorConfig();@@ -422,15 +425,15 @@ describe('UPlotConfigBuilder', () => {const mockWidth = 100;calculateWidthBasedOnStepIntervalMock.mockReturnValue(mockWidth);- const builder = new UPlotConfigBuilder({ stepInterval });+ const builder = new UPlotConfigBuilder({ id: 'widget-123', stepInterval });const cursorConfig = builder.getCursorConfig();expect(typeof cursorConfig.hover?.prox).toBe('function');const uPlotInstance = {} as uPlot;- const proxResult = (cursorConfig.hover!.prox as (u: uPlot) => number)(- uPlotInstance,- );+ const prox = cursorConfig.hover?.prox as ((u: uPlot) => number) | undefined;+ expect(prox).toBeDefined();+ const proxResult = prox ? prox(uPlotInstance) : NaN;expect(calculateWidthBasedOnStepIntervalMock).toHaveBeenCalledWith({uPlotInstance,@@ -441,7 +444,7 @@ describe('UPlotConfigBuilder', () => {});it('adds plugins and includes them in config', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const plugin: uPlot.Plugin = {opts: (): void => {},hooks: {},@@ -456,7 +459,7 @@ describe('UPlotConfigBuilder', () => {it('sets padding, legend, focus, select, tzDate, bands and includes them in config', () => {const tzDate = (ts: number): Date => new Date(ts);- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const bands: uPlot.Band[] = [{ series: [1, 2], fill: (): string => '#000' }];@@ -478,7 +481,7 @@ describe('UPlotConfigBuilder', () => {});it('does not include plugins when none added', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const config = builder.getConfig();@@ -486,7 +489,7 @@ describe('UPlotConfigBuilder', () => {});it('does not include bands when empty', () => {- const builder = new UPlotConfigBuilder();+ const builder = new UPlotConfigBuilder({ id: 'widget-123' });const config = builder.getConfig();diff --git a/frontend/src/lib/uPlotV2/config/types.ts b/frontend/src/lib/uPlotV2/config/types.tsindex 04209c68ba..bf3f85d8fc 100644--- a/frontend/src/lib/uPlotV2/config/types.ts+++ b/frontend/src/lib/uPlotV2/config/types.ts@@ -34,7 +34,7 @@ export enum SelectionPreferencesSource {* Props for configuring the uPlot config builder*/export interface ConfigBuilderProps {- widgetId?: string;+ id: string;onDragSelect?: (startTime: number, endTime: number) => void;tzDate?: uPlot.LocalDateFromUnix;selectionPreferencesSource?: SelectionPreferencesSource;diff --git a/frontend/src/lib/uPlotV2/context/PlotContext.tsx b/frontend/src/lib/uPlotV2/context/PlotContext.tsxindex cfee3e982d..07f1f2ed3f 100644--- a/frontend/src/lib/uPlotV2/context/PlotContext.tsx+++ b/frontend/src/lib/uPlotV2/context/PlotContext.tsx@@ -13,7 +13,7 @@ import { updateSeriesVisibilityToLocalStorage } from 'container/DashboardContainimport type uPlot from 'uplot';export interface PlotContextInitialState {uPlotInstance: uPlot | null;- widgetId?: string;+ id?: string;shouldSaveSelectionPreference?: boolean;}export interface IPlotContext {@@ -31,17 +31,17 @@ export const PlotContextProvider = ({}: PropsWithChildren): JSX.Element => {const uPlotInstanceRef = useRef<uPlot | null>(null);const activeSeriesIndex = useRef<number | undefined>(undefined);- const widgetIdRef = useRef<string | undefined>(undefined);+ const idRef = useRef<string | undefined>(undefined);const shouldSavePreferencesRef = useRef<boolean>(false);const setPlotContextInitialState = useCallback(({uPlotInstance,- widgetId,+ id,shouldSaveSelectionPreference,}: PlotContextInitialState): void => {uPlotInstanceRef.current = uPlotInstance;- widgetIdRef.current = widgetId;+ idRef.current = id;activeSeriesIndex.current = undefined;shouldSavePreferencesRef.current = !!shouldSaveSelectionPreference;},@@ -50,7 +50,7 @@ export const PlotContextProvider = ({const syncSeriesVisibilityToLocalStorage = useCallback((): void => {const plot = uPlotInstanceRef.current;- if (!plot || !widgetIdRef.current) {+ if (!plot || !idRef.current) {return;}@@ -61,7 +61,7 @@ export const PlotContextProvider = ({}),);- updateSeriesVisibilityToLocalStorage(widgetIdRef.current, seriesVisibility);+ updateSeriesVisibilityToLocalStorage(idRef.current, seriesVisibility);}, []);const onToggleSeriesVisibility = useCallback(@@ -84,7 +84,7 @@ export const PlotContextProvider = ({show: isReset || currentSeriesIndex === seriesIndex,});});- if (widgetIdRef.current && shouldSavePreferencesRef.current) {+ if (idRef.current && shouldSavePreferencesRef.current) {syncSeriesVisibilityToLocalStorage();}});@@ -104,7 +104,7 @@ export const PlotContextProvider = ({return;}plot.setSeries(seriesIndex, { show: !series.show });- if (widgetIdRef.current && shouldSavePreferencesRef.current) {+ if (idRef.current && shouldSavePreferencesRef.current) {syncSeriesVisibilityToLocalStorage();}},diff --git a/frontend/src/lib/uPlotV2/context/__tests__/PlotContext.test.tsx b/frontend/src/lib/uPlotV2/context/__tests__/PlotContext.test.tsxindex a7e092d829..9bbf720c96 100644--- a/frontend/src/lib/uPlotV2/context/__tests__/PlotContext.test.tsx+++ b/frontend/src/lib/uPlotV2/context/__tests__/PlotContext.test.tsx@@ -32,13 +32,13 @@ const createMockPlot = (series: MockSeries[] = []): uPlot =>interface TestComponentProps {plot?: uPlot;- widgetId?: string;+ id?: string;shouldSaveSelectionPreference?: boolean;}const TestComponent = ({plot,- widgetId,+ id,shouldSaveSelectionPreference,}: TestComponentProps): JSX.Element => {const {@@ -49,17 +49,13 @@ const TestComponent = ({onFocusSeries,} = usePlotContext();const handleInit = (): void => {- if (- !plot ||- !widgetId ||- typeof shouldSaveSelectionPreference !== 'boolean'- ) {+ if (!plot || !id || typeof shouldSaveSelectionPreference !== 'boolean') {return;}setPlotContextInitialState({uPlotInstance: plot,- widgetId,+ id,shouldSaveSelectionPreference,});};@@ -148,11 +144,7 @@ describe('PlotContext', () => {render(<PlotContextProvider>- <TestComponent- plot={plot}- widgetId="widget-123"- shouldSaveSelectionPreference- />+ <TestComponent plot={plot} id="widget-123" shouldSaveSelectionPreference /></PlotContextProvider>,);@@ -199,7 +191,7 @@ describe('PlotContext', () => {<PlotContextProvider><TestComponentplot={plot}- widgetId="widget-visibility"+ id="widget-visibility"shouldSaveSelectionPreference/></PlotContextProvider>,@@ -240,7 +232,7 @@ describe('PlotContext', () => {<PlotContextProvider><TestComponentplot={plot}- widgetId="widget-reset"+ id="widget-reset"shouldSaveSelectionPreference/></PlotContextProvider>,@@ -290,7 +282,7 @@ describe('PlotContext', () => {<PlotContextProvider><TestComponentplot={plot}- widgetId="widget-toggle"+ id="widget-toggle"shouldSaveSelectionPreference/></PlotContextProvider>,@@ -316,7 +308,7 @@ describe('PlotContext', () => {<PlotContextProvider><TestComponentplot={plot}- widgetId="widget-missing-series"+ id="widget-missing-series"shouldSaveSelectionPreference/></PlotContextProvider>,@@ -341,7 +333,7 @@ describe('PlotContext', () => {<PlotContextProvider><TestComponentplot={plot}- widgetId="widget-no-persist"+ id="widget-no-persist"shouldSaveSelectionPreference={false}/></PlotContextProvider>,@@ -379,7 +371,7 @@ describe('PlotContext', () => {<PlotContextProvider><TestComponentplot={plot}- widgetId="widget-focus"+ id="widget-focus"shouldSaveSelectionPreference={false}/></PlotContextProvider>,diff --git a/frontend/src/lib/uPlotV2/plugins/__tests__/TooltipPlugin.test.ts b/frontend/src/lib/uPlotV2/plugins/__tests__/TooltipPlugin.test.tsindex fae122c590..a4a963bfb2 100644--- a/frontend/src/lib/uPlotV2/plugins/__tests__/TooltipPlugin.test.ts+++ b/frontend/src/lib/uPlotV2/plugins/__tests__/TooltipPlugin.test.ts@@ -40,7 +40,7 @@ class TestConfigBuilder extends UPlotConfigBuilder {type ConfigMock = TestConfigBuilder;function createConfigMock(): ConfigMock {- return new TestConfigBuilder();+ return new TestConfigBuilder({ id: 'test-widget' });}function getHandler(config: ConfigMock, hookName: string): HookHandler {