Skip to content

Commit

Permalink
test(ui): Remove duplicate global test mocks (#77967)
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Sep 23, 2024
1 parent a7e811b commit ec2d760
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions static/app/actionCreators/account.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {waitFor} from 'sentry-test/reactTestingLibrary';

import {logout} from './account';

jest.mock('react-router-dom');

describe('logout', () => {
it('has can logout', async function () {
jest.spyOn(window.location, 'assign').mockImplementation(() => {});
Expand Down
2 changes: 0 additions & 2 deletions static/app/utils/replays/hooks/useActiveReplayTab.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {renderHook} from 'sentry-test/reactTestingLibrary';
import {browserHistory} from 'sentry/utils/browserHistory';
import useActiveReplayTab, {TabKey} from 'sentry/utils/replays/hooks/useActiveReplayTab';

jest.mock('react-router');

const mockPush = jest.mocked(browserHistory.push);

function mockLocation(query: string = '') {
Expand Down
1 change: 0 additions & 1 deletion static/app/utils/useCleanQueryParamsOnRouteLeave.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import useCleanQueryParamsOnRouteLeave, {
} from './useCleanQueryParamsOnRouteLeave';
import {useLocation} from './useLocation';

jest.mock('react-router');
jest.mock('./useLocation');

const MockBrowserHistoryListen = jest.mocked(browserHistory.listen);
Expand Down
2 changes: 0 additions & 2 deletions static/app/utils/useUrlParams.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {browserHistory} from 'sentry/utils/browserHistory';

import useUrlParams from './useUrlParams';

jest.mock('react-router');

describe('useUrlParams', () => {
beforeEach(() => {
window.location.search = qs.stringify({
Expand Down
1 change: 0 additions & 1 deletion static/app/views/alerts/create.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jest.mock('sentry/actionCreators/members', () => ({
return {};
}),
}));
jest.mock('react-router');
jest.mock('sentry/utils/analytics', () => ({
metric: {
startSpan: jest.fn(() => ({
Expand Down
2 changes: 0 additions & 2 deletions static/app/views/projectsDashboard/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import ProjectsStatsStore from 'sentry/stores/projectsStatsStore';
import ProjectsStore from 'sentry/stores/projectsStore';
import {Dashboard} from 'sentry/views/projectsDashboard';

jest.mock('sentry/api');

jest.unmock('lodash/debounce');
jest.mock('lodash/debounce', () => {
const debounceMap = new Map();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {useLocation} from 'sentry/utils/useLocation';
import type {FilterFields} from 'sentry/views/replays/detail/console/useConsoleFilters';
import useConsoleFilters from 'sentry/views/replays/detail/console/useConsoleFilters';

jest.mock('react-router');
jest.mock('sentry/utils/useLocation');

const mockUseLocation = jest.mocked(useLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type {
} from 'sentry/views/replays/detail/errorList/useErrorFilters';
import useErrorFilters from 'sentry/views/replays/detail/errorList/useErrorFilters';

jest.mock('react-router');
jest.mock('sentry/utils/useLocation');

const mockUseLocation = jest.mocked(useLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {act, renderHook} from 'sentry-test/reactTestingLibrary';
import hydrateErrors from 'sentry/utils/replays/hydrateErrors';
import useSortErrors from 'sentry/views/replays/detail/errorList/useSortErrors';

jest.mock('react-router');
jest.mock('sentry/utils/useUrlParams', () => {
const map = new Map();
return (name, dflt) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {useLocation} from 'sentry/utils/useLocation';
import type {FilterFields, NetworkSelectOption} from './useNetworkFilters';
import useNetworkFilters from './useNetworkFilters';

jest.mock('react-router');
jest.mock('sentry/utils/useLocation');

const mockUseLocation = jest.mocked(useLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import hydrateSpans from 'sentry/utils/replays/hydrateSpans';

import useSortNetwork from './useSortNetwork';

jest.mock('react-router');
jest.mock('sentry/utils/useUrlParams', () => {
const map = new Map();
return (name, dflt) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {useLocation} from 'sentry/utils/useLocation';
import type {FilterFields} from 'sentry/views/replays/detail/tagPanel/useTagFilters';
import useTagFilters from 'sentry/views/replays/detail/tagPanel/useTagFilters';

jest.mock('react-router');
jest.mock('sentry/utils/useLocation');

const mockUseLocation = jest.mocked(useLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import {browserHistory} from 'sentry/utils/browserHistory';
import OrganizationMembersList from 'sentry/views/settings/organizationMembers/organizationMembersList';

jest.mock('sentry/utils/analytics');

jest.mock('sentry/api');
jest.mock('sentry/actionCreators/indicator');

const roles = [
Expand Down

0 comments on commit ec2d760

Please sign in to comment.