From d70be3a85630658e3cf2b3bd4fe27a80687e8b9a Mon Sep 17 00:00:00 2001 From: Levente Balogh Date: Mon, 16 Dec 2024 21:14:56 +0100 Subject: [PATCH] Wip --- .../scenes/src/components/SceneApp/SceneApp.test.tsx | 10 +++++++--- packages/scenes/src/components/SceneApp/SceneApp.tsx | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/scenes/src/components/SceneApp/SceneApp.test.tsx b/packages/scenes/src/components/SceneApp/SceneApp.test.tsx index 9f7f234bb..0ce390bb1 100644 --- a/packages/scenes/src/components/SceneApp/SceneApp.test.tsx +++ b/packages/scenes/src/components/SceneApp/SceneApp.test.tsx @@ -1,5 +1,5 @@ import { NavModelItem } from '@grafana/data'; -import { locationService, PluginPage } from '@grafana/runtime'; +import { locationService, PluginPage, PluginPageProps } from '@grafana/runtime'; import { screen, render } from '@testing-library/react'; import React from 'react'; import { renderAppInsideRouterWithStartingUrl } from '../../../utils/test/utils'; @@ -12,8 +12,12 @@ import { SceneAppPage } from './SceneAppPage'; import { SceneRouteMatch } from './types'; import { SceneReactObject } from '../SceneReactObject'; -// Mock lives in ./__mocks__/@grafana/runtime.js -jest.mock('@grafana/runtime'); +jest.mock('@grafana/runtime', () => ({ + ...jest.requireActual('@grafana/runtime'), + PluginPage: (props: PluginPageProps) => { + return
{props.children}
; + }, +})); jest.mock('../../utils/utils', () => ({ ...jest.requireActual('../../utils/utils'), useLocationServiceSafe: () => locationService, diff --git a/packages/scenes/src/components/SceneApp/SceneApp.tsx b/packages/scenes/src/components/SceneApp/SceneApp.tsx index 38ff66f58..f141411b2 100644 --- a/packages/scenes/src/components/SceneApp/SceneApp.tsx +++ b/packages/scenes/src/components/SceneApp/SceneApp.tsx @@ -5,6 +5,10 @@ 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 */