⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
test
/
mocks
/
View File Name :
getGrafanaContextMock.ts
import { GrafanaConfig } from '@grafana/data'; import { LocationService } from '@grafana/runtime'; import { AppChromeService } from 'app/core/components/AppChrome/AppChromeService'; import { GrafanaContextType } from 'app/core/context/GrafanaContext'; import { NewFrontendAssetsChecker } from 'app/core/services/NewFrontendAssetsChecker'; import { backendSrv } from 'app/core/services/backend_srv'; import { KeybindingSrv } from 'app/core/services/keybindingSrv'; /** Not sure what this should evolve into, just a starting point */ export function getGrafanaContextMock(overrides: Partial
= {}): GrafanaContextType { return { chrome: new AppChromeService(), backend: backendSrv, // eslint-disable-next-line location: {} as LocationService, // eslint-disable-next-line config: { featureToggles: {} } as GrafanaConfig, // eslint-disable-next-line keybindings: { clearAndInitGlobalBindings: jest.fn(), setupDashboardBindings: jest.fn(), setupTimeRangeBindings: jest.fn(), } as unknown as KeybindingSrv, newAssetsChecker: { start: jest.fn(), reloadIfUpdateDetected: jest.fn(), } as unknown as NewFrontendAssetsChecker, ...overrides, }; }