mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 22:23:39 +08:00

* Fix infinite loop caused by history state not being cleaned up * Ude forceRouteReload counter instead of bool flag * Review fix
25 lines
653 B
TypeScript
25 lines
653 B
TypeScript
import React from 'react';
|
|
import { render } from '@testing-library/react';
|
|
import { GrafanaRoute } from './GrafanaRoute';
|
|
|
|
describe('GrafanaRoute', () => {
|
|
it('Parses search', () => {
|
|
let capturedProps: any;
|
|
|
|
const PageComponent = (props: any) => {
|
|
capturedProps = props;
|
|
return <div />;
|
|
};
|
|
|
|
const location = { search: '?query=hello&test=asd' } as any;
|
|
const history = {} as any;
|
|
const match = {} as any;
|
|
|
|
render(
|
|
<GrafanaRoute location={location} history={history} match={match} route={{ component: PageComponent } as any} />
|
|
);
|
|
|
|
expect(capturedProps.queryParams.query).toBe('hello');
|
|
});
|
|
});
|