mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
* Initial progress * Moving keybindingSrv to context * Simplfy KioskMode * Removed unused logic * Make kiosk=tv behave as before but when topnav is enabled * Minor fix * Fixing tests * Fixing bug with notice when entering kiosk mode * Fixed test
26 lines
981 B
TypeScript
26 lines
981 B
TypeScript
import { GrafanaConfig } from '@grafana/data';
|
|
import { BackendSrv, LocationService } from '@grafana/runtime';
|
|
import { AppChromeService } from 'app/core/components/AppChrome/AppChromeService';
|
|
import { GrafanaContextType } from 'app/core/context/GrafanaContext';
|
|
import { KeybindingSrv } from 'app/core/services/keybindingSrv';
|
|
|
|
/** Not sure what this should evolve into, just a starting point */
|
|
export function getGrafanaContextMock(overrides: Partial<GrafanaContextType> = {}): GrafanaContextType {
|
|
return {
|
|
chrome: new AppChromeService(),
|
|
// eslint-disable-next-line
|
|
backend: {} as BackendSrv,
|
|
// eslint-disable-next-line
|
|
location: {} as LocationService,
|
|
// eslint-disable-next-line
|
|
config: {} as GrafanaConfig,
|
|
// eslint-disable-next-line
|
|
keybindings: {
|
|
clearAndInitGlobalBindings: jest.fn(),
|
|
setupDashboardBindings: jest.fn(),
|
|
setupTimeRangeBindings: jest.fn(),
|
|
} as any as KeybindingSrv,
|
|
...overrides,
|
|
};
|
|
}
|