Ver Fonte

Fix metrics panel test by adding config mock

David Kaltschmidt há 7 anos atrás
pai
commit
3bd58446d6
1 ficheiros alterados com 12 adições e 1 exclusões
  1. 12 1
      public/app/features/panel/specs/metrics_panel_ctrl.jest.ts

+ 12 - 1
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;