mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 06:12:59 +08:00
Chore: fix type errors in tests (#63270)
* fix any's in tests * fix more any's in tests * more test type fixes * fixing any's in tests part 3 * more test type fixes * fixing test any's p5 * some tidy up * fix template_srv
This commit is contained in:
@ -9,6 +9,7 @@ import { getMockPlugin } from '@grafana/data/test/__mocks__/pluginMocks';
|
||||
import { locationService, setEchoSrv } from '@grafana/runtime';
|
||||
import { GrafanaContext } from 'app/core/context/GrafanaContext';
|
||||
import { GrafanaRoute } from 'app/core/navigation/GrafanaRoute';
|
||||
import { RouteDescriptor } from 'app/core/navigation/types';
|
||||
import { Echo } from 'app/core/services/echo/Echo';
|
||||
import { configureStore } from 'app/store/configureStore';
|
||||
|
||||
@ -90,14 +91,16 @@ function renderUnderRouter() {
|
||||
appPluginNavItem.parentItem = appsSection;
|
||||
|
||||
const store = configureStore();
|
||||
const route = { component: () => <AppRootPage pluginId="my-awesome-plugin" pluginNavSection={appsSection} /> };
|
||||
const route = {
|
||||
component: () => <AppRootPage pluginId="my-awesome-plugin" pluginNavSection={appsSection} />,
|
||||
} as unknown as RouteDescriptor;
|
||||
locationService.push('/a/my-awesome-plugin');
|
||||
|
||||
render(
|
||||
<Router history={locationService.getHistory()}>
|
||||
<Provider store={store}>
|
||||
<GrafanaContext.Provider value={getGrafanaContextMock()}>
|
||||
<Route path="/a/:pluginId" exact render={(props) => <GrafanaRoute {...props} route={route as any} />} />
|
||||
<Route path="/a/:pluginId" exact render={(props) => <GrafanaRoute {...props} route={route} />} />
|
||||
</GrafanaContext.Provider>
|
||||
</Provider>
|
||||
</Router>
|
||||
|
Reference in New Issue
Block a user