From 3bd58446d61aef25a7195f2722e56d117c56527e Mon Sep 17 00:00:00 2001 From: David Kaltschmidt Date: Wed, 6 Jun 2018 11:15:24 +0200 Subject: [PATCH] Fix metrics panel test by adding config mock --- .../features/panel/specs/metrics_panel_ctrl.jest.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/public/app/features/panel/specs/metrics_panel_ctrl.jest.ts b/public/app/features/panel/specs/metrics_panel_ctrl.jest.ts index 79564e2a123..a28bf92e63b 100644 --- a/public/app/features/panel/specs/metrics_panel_ctrl.jest.ts +++ b/public/app/features/panel/specs/metrics_panel_ctrl.jest.ts @@ -1,8 +1,19 @@ jest.mock('app/core/core', () => ({})); +jest.mock('app/core/config', () => { + return { + exploreEnabled: true, + panels: { + test: { + id: 'test', + name: 'test', + }, + }, + }; +}); -import { MetricsPanelCtrl } from '../metrics_panel_ctrl'; import q from 'q'; import { PanelModel } from 'app/features/dashboard/panel_model'; +import { MetricsPanelCtrl } from '../metrics_panel_ctrl'; describe('MetricsPanelCtrl', () => { let ctrl;