Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
leventebalogh committed Dec 13, 2024
1 parent d76b04a commit 08fe185
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 19 deletions.
18 changes: 9 additions & 9 deletions packages/scenes/__mocks__/@grafana/__runtime.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const React = require('react');
const runtime = jest.requireActual('@grafana/runtime');
// const React = require('react');
// const runtime = jest.requireActual('@grafana/runtime');

runtime.PluginPage = jest.fn().mockImplementation((props) => {
return React.createElement('div', null, props.children);
});
// runtime.PluginPage = jest.fn().mockImplementation((props) => {
// return React.createElement('div', null, props.children);
// });

runtime.getPluginImportUtils = () => ({
getPanelPluginFromCache: jest.fn(() => pluginToLoad),
});
// runtime.getPluginImportUtils = () => ({
// getPanelPluginFromCache: jest.fn(() => pluginToLoad),
// });

module.exports = runtime;
// module.exports = runtime;
2 changes: 1 addition & 1 deletion packages/scenes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@emotion/react": "11.10.5",
"@grafana/eslint-config": "5.1.0",
"@grafana/tsconfig": "^1.3.0-rc1",
"@swc/core": "^1.2.162",
"@swc/core": "^1.10.1",
"@swc/jest": "^0.2.37",
"@testing-library/dom": "9.3.4",
"@testing-library/jest-dom": "6.4.2",
Expand Down
8 changes: 1 addition & 7 deletions packages/scenes/src/components/SceneApp/SceneApp.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ import { SceneRouteMatch } from './types';
import { SceneReactObject } from '../SceneReactObject';

// Mock lives in __mocks__/@grafana/runtime
jest.mock('@grafana/runtime', () => ({
...jest.requireActual('@grafana/runtime'),
PluginPage: jest.fn().mockImplementation(({ children }) => {
return <div>{children}</div>;
}),
}));

jest.mock('@grafana/runtime');
jest.mock('../../utils/utils', () => ({
...jest.requireActual('../../utils/utils'),
useLocationServiceSafe: () => locationService,
Expand Down
2 changes: 1 addition & 1 deletion packages/scenes/src/components/SceneApp/SceneAppPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Route, Routes, useMatch, useMatches } from 'react-router-dom';
import { Route, Routes } from 'react-router-dom';
import { SceneObjectBase } from '../../core/SceneObjectBase';
import { SceneComponentProps, SceneObject, isDataRequestEnricher } from '../../core/types';
import { EmbeddedScene } from '../EmbeddedScene';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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;
127 changes: 126 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3793,7 +3793,7 @@ __metadata:
"@grafana/eslint-config": "npm:5.1.0"
"@grafana/tsconfig": "npm:^1.3.0-rc1"
"@leeoniya/ufuzzy": "npm:^1.0.16"
"@swc/core": "npm:^1.2.162"
"@swc/core": "npm:^1.10.1"
"@swc/jest": "npm:^0.2.37"
"@tanstack/react-virtual": "npm:^3.9.0"
"@testing-library/dom": "npm:9.3.4"
Expand Down Expand Up @@ -6067,76 +6067,192 @@ __metadata:
languageName: node
linkType: hard

"@swc/core-darwin-arm64@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-darwin-arm64@npm:1.10.1"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@swc/core-darwin-arm64@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-darwin-arm64@npm:1.3.70"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@swc/core-darwin-x64@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-darwin-x64@npm:1.10.1"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@swc/core-darwin-x64@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-darwin-x64@npm:1.3.70"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@swc/core-linux-arm-gnueabihf@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.10.1"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@swc/core-linux-arm-gnueabihf@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.70"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@swc/core-linux-arm64-gnu@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-linux-arm64-gnu@npm:1.10.1"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-arm64-gnu@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.70"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-arm64-musl@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-linux-arm64-musl@npm:1.10.1"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-arm64-musl@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-linux-arm64-musl@npm:1.3.70"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-x64-gnu@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-linux-x64-gnu@npm:1.10.1"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-x64-gnu@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-linux-x64-gnu@npm:1.3.70"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-x64-musl@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-linux-x64-musl@npm:1.10.1"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-x64-musl@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-linux-x64-musl@npm:1.3.70"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@swc/core-win32-arm64-msvc@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-win32-arm64-msvc@npm:1.10.1"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@swc/core-win32-arm64-msvc@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.70"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@swc/core-win32-ia32-msvc@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-win32-ia32-msvc@npm:1.10.1"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@swc/core-win32-ia32-msvc@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.70"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@swc/core-win32-x64-msvc@npm:1.10.1":
version: 1.10.1
resolution: "@swc/core-win32-x64-msvc@npm:1.10.1"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@swc/core-win32-x64-msvc@npm:1.3.70":
version: 1.3.70
resolution: "@swc/core-win32-x64-msvc@npm:1.3.70"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@swc/core@npm:^1.10.1":
version: 1.10.1
resolution: "@swc/core@npm:1.10.1"
dependencies:
"@swc/core-darwin-arm64": "npm:1.10.1"
"@swc/core-darwin-x64": "npm:1.10.1"
"@swc/core-linux-arm-gnueabihf": "npm:1.10.1"
"@swc/core-linux-arm64-gnu": "npm:1.10.1"
"@swc/core-linux-arm64-musl": "npm:1.10.1"
"@swc/core-linux-x64-gnu": "npm:1.10.1"
"@swc/core-linux-x64-musl": "npm:1.10.1"
"@swc/core-win32-arm64-msvc": "npm:1.10.1"
"@swc/core-win32-ia32-msvc": "npm:1.10.1"
"@swc/core-win32-x64-msvc": "npm:1.10.1"
"@swc/counter": "npm:^0.1.3"
"@swc/types": "npm:^0.1.17"
peerDependencies:
"@swc/helpers": "*"
dependenciesMeta:
"@swc/core-darwin-arm64":
optional: true
"@swc/core-darwin-x64":
optional: true
"@swc/core-linux-arm-gnueabihf":
optional: true
"@swc/core-linux-arm64-gnu":
optional: true
"@swc/core-linux-arm64-musl":
optional: true
"@swc/core-linux-x64-gnu":
optional: true
"@swc/core-linux-x64-musl":
optional: true
"@swc/core-win32-arm64-msvc":
optional: true
"@swc/core-win32-ia32-msvc":
optional: true
"@swc/core-win32-x64-msvc":
optional: true
peerDependenciesMeta:
"@swc/helpers":
optional: true
checksum: 10/e9c8a42488db77b3c199d1696d45bb9c7e917267e810c091e5161a7096f3db9c01813ade1e942290285210b4590ec7a00399b2ba3edc4d8cae9b2e824fac7d45
languageName: node
linkType: hard

"@swc/core@npm:^1.2.144, @swc/core@npm:^1.2.162":
version: 1.3.70
resolution: "@swc/core@npm:1.3.70"
Expand Down Expand Up @@ -6232,6 +6348,15 @@ __metadata:
languageName: node
linkType: hard

"@swc/types@npm:^0.1.17":
version: 0.1.17
resolution: "@swc/types@npm:0.1.17"
dependencies:
"@swc/counter": "npm:^0.1.3"
checksum: 10/ddef1ad5bfead3acdfc41f14e79ba43a99200eb325afbad5716058dbe36358b0513400e9f22aff32432be84a98ae93df95a20b94192f69b8687144270e4eaa18
languageName: node
linkType: hard

"@szmarczak/http-timer@npm:^5.0.1":
version: 5.0.1
resolution: "@szmarczak/http-timer@npm:5.0.1"
Expand Down

0 comments on commit 08fe185

Please sign in to comment.