mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
@@ -5,7 +5,7 @@ import { BrowserRouter } from 'react-router-dom';
|
||||
import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';
|
||||
|
||||
import { NavModel, NavModelItem } from '@grafana/data';
|
||||
import { setBackendSrv } from '@grafana/runtime';
|
||||
import { BackendSrv, setBackendSrv } from '@grafana/runtime';
|
||||
import { GrafanaContext } from 'app/core/context/GrafanaContext';
|
||||
import { configureStore } from 'app/store/configureStore';
|
||||
|
||||
@@ -23,7 +23,7 @@ jest.mock('@grafana/runtime', () => ({
|
||||
|
||||
setBackendSrv({
|
||||
get: jest.fn().mockResolvedValue([]),
|
||||
} as any);
|
||||
} as unknown as BackendSrv);
|
||||
|
||||
describe('DashboardSettings', () => {
|
||||
it('pressing escape navigates away correctly', async () => {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';
|
||||
import { byRole } from 'testing-library-selector';
|
||||
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { setBackendSrv } from '@grafana/runtime';
|
||||
import { BackendSrv, setBackendSrv } from '@grafana/runtime';
|
||||
import { GrafanaContext } from 'app/core/context/GrafanaContext';
|
||||
|
||||
import { DashboardModel } from '../../state';
|
||||
@@ -16,7 +16,7 @@ import { GeneralSettingsUnconnected as GeneralSettings, Props } from './GeneralS
|
||||
|
||||
setBackendSrv({
|
||||
get: jest.fn().mockResolvedValue([]),
|
||||
} as any);
|
||||
} as unknown as BackendSrv);
|
||||
|
||||
const setupTestContext = (options: Partial<Props>) => {
|
||||
const defaults: Props = {
|
||||
|
||||
@@ -37,7 +37,9 @@ export function GeneralSettingsUnconnected({
|
||||
};
|
||||
|
||||
const onBlur = (event: React.FocusEvent<HTMLInputElement>) => {
|
||||
dashboard[event.currentTarget.name as 'title' | 'description'] = event.currentTarget.value;
|
||||
if (event.currentTarget.name === 'title' || event.currentTarget.name === 'description') {
|
||||
dashboard[event.currentTarget.name] = event.currentTarget.value;
|
||||
}
|
||||
};
|
||||
|
||||
const onTooltipChange = (graphTooltip: number) => {
|
||||
|
||||
@@ -21,7 +21,7 @@ type State = {
|
||||
isAppending: boolean;
|
||||
versions: DecoratedRevisionModel[];
|
||||
viewMode: 'list' | 'compare';
|
||||
diffData: { lhs: any; rhs: any };
|
||||
diffData: { lhs: unknown; rhs: unknown };
|
||||
newInfo?: DecoratedRevisionModel;
|
||||
baseInfo?: DecoratedRevisionModel;
|
||||
isNewLatest: boolean;
|
||||
|
||||
Reference in New Issue
Block a user