Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
leventebalogh committed Dec 16, 2024
1 parent 430dc9d commit d70be3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/scenes/src/components/SceneApp/SceneApp.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 <div>{props.children}</div>;
},
}));
jest.mock('../../utils/utils', () => ({
...jest.requireActual('../../utils/utils'),
useLocationServiceSafe: () => locationService,
Expand Down
4 changes: 4 additions & 0 deletions packages/scenes/src/components/SceneApp/SceneApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit d70be3a

Please sign in to comment.