From 77516f0e90b27828353f978e7b2d235b03ec7877 Mon Sep 17 00:00:00 2001 From: Levente Balogh Date: Mon, 16 Dec 2024 21:17:28 +0100 Subject: [PATCH] Wip --- .../scenes/src/components/SceneApp/SceneApp.test.tsx | 4 ++-- packages/scenes/src/components/SceneApp/SceneApp.tsx | 4 ---- .../SceneApp/__mocks__/@grafana/__runtime.js | 12 ------------ 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 packages/scenes/src/components/SceneApp/__mocks__/@grafana/__runtime.js diff --git a/packages/scenes/src/components/SceneApp/SceneApp.test.tsx b/packages/scenes/src/components/SceneApp/SceneApp.test.tsx index 0ce390bb1..5ed40b081 100644 --- a/packages/scenes/src/components/SceneApp/SceneApp.test.tsx +++ b/packages/scenes/src/components/SceneApp/SceneApp.test.tsx @@ -14,9 +14,9 @@ import { SceneReactObject } from '../SceneReactObject'; jest.mock('@grafana/runtime', () => ({ ...jest.requireActual('@grafana/runtime'), - PluginPage: (props: PluginPageProps) => { + PluginPage: jest.fn().mockImplementation((props: PluginPageProps) => { return
{props.children}
; - }, + }), })); jest.mock('../../utils/utils', () => ({ ...jest.requireActual('../../utils/utils'), diff --git a/packages/scenes/src/components/SceneApp/SceneApp.tsx b/packages/scenes/src/components/SceneApp/SceneApp.tsx index f141411b2..38ff66f58 100644 --- a/packages/scenes/src/components/SceneApp/SceneApp.tsx +++ b/packages/scenes/src/components/SceneApp/SceneApp.tsx @@ -5,10 +5,6 @@ import { DataRequestEnricher, SceneComponentProps } from '../../core/types'; import { SceneObjectBase } from '../../core/SceneObjectBase'; import { SceneAppState } from './types'; -import { PluginPage } from '@grafana/runtime'; - -console.log('>>> SceneApp / PluginPage <<<', PluginPage.toString()); - /** * Responsible for top level pages routing */ diff --git a/packages/scenes/src/components/SceneApp/__mocks__/@grafana/__runtime.js b/packages/scenes/src/components/SceneApp/__mocks__/@grafana/__runtime.js deleted file mode 100644 index 8e5f47ea9..000000000 --- a/packages/scenes/src/components/SceneApp/__mocks__/@grafana/__runtime.js +++ /dev/null @@ -1,12 +0,0 @@ -const React = require('react'); -const runtime = jest.requireActual('@grafana/runtime'); - -runtime.PluginPage = jest.fn().mockImplementation((props) => { - return React.createElement('div', null, props.children); -}); - -runtime.getPluginImportUtils = () => ({ - getPanelPluginFromCache: jest.fn(() => pluginToLoad), -}); - -module.exports = runtime;