|
@@ -4,7 +4,6 @@ import {LocationFixture} from 'sentry-fixture/locationFixture';
|
|
|
import {initializeOrg} from 'sentry-test/initializeOrg';
|
|
|
|
|
|
import {COL_WIDTH_UNDEFINED} from 'sentry/components/gridEditable';
|
|
|
-import {browserHistory} from 'sentry/utils/browserHistory';
|
|
|
import type {EventViewOptions} from 'sentry/utils/discover/eventView';
|
|
|
import EventView from 'sentry/utils/discover/eventView';
|
|
|
import {DisplayType} from 'sentry/views/dashboards/types';
|
|
@@ -252,14 +251,16 @@ describe('pushEventViewToLocation', function () {
|
|
|
});
|
|
|
|
|
|
it('correct query string object pushed to history', function () {
|
|
|
+ const navigate = jest.fn();
|
|
|
const eventView = new EventView({...baseView, ...state});
|
|
|
|
|
|
pushEventViewToLocation({
|
|
|
+ navigate,
|
|
|
location,
|
|
|
nextEventView: eventView,
|
|
|
});
|
|
|
|
|
|
- expect(browserHistory.push).toHaveBeenCalledWith(
|
|
|
+ expect(navigate).toHaveBeenCalledWith(
|
|
|
expect.objectContaining({
|
|
|
query: expect.objectContaining({
|
|
|
id: '1234',
|
|
@@ -280,9 +281,11 @@ describe('pushEventViewToLocation', function () {
|
|
|
});
|
|
|
|
|
|
it('extra query params', function () {
|
|
|
+ const navigate = jest.fn();
|
|
|
const eventView = new EventView({...baseView, ...state});
|
|
|
|
|
|
pushEventViewToLocation({
|
|
|
+ navigate,
|
|
|
location,
|
|
|
nextEventView: eventView,
|
|
|
extraQuery: {
|
|
@@ -290,7 +293,7 @@ describe('pushEventViewToLocation', function () {
|
|
|
},
|
|
|
});
|
|
|
|
|
|
- expect(browserHistory.push).toHaveBeenCalledWith(
|
|
|
+ expect(navigate).toHaveBeenCalledWith(
|
|
|
expect.objectContaining({
|
|
|
query: expect.objectContaining({
|
|
|
id: '1234',
|