From 01c206fdb67e50aff6d909e528a60fd76d682364 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Fri, 27 Sep 2024 14:46:11 -0700 Subject: [PATCH] fix other tests --- .../app/views/issueDetails/streamline/header.spec.tsx | 11 +++++++---- .../app/views/issueDetails/useGroupDetailsRoute.tsx | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/static/app/views/issueDetails/streamline/header.spec.tsx b/static/app/views/issueDetails/streamline/header.spec.tsx index 6f92e69941e7e9..73f3d1702f4a6c 100644 --- a/static/app/views/issueDetails/streamline/header.spec.tsx +++ b/static/app/views/issueDetails/streamline/header.spec.tsx @@ -3,6 +3,7 @@ import {LocationFixture} from 'sentry-fixture/locationFixture'; import {OrganizationFixture} from 'sentry-fixture/organization'; import {ProjectFixture} from 'sentry-fixture/project'; import {ReleaseFixture} from 'sentry-fixture/release'; +import {RouterFixture} from 'sentry-fixture/routerFixture'; import {TeamFixture} from 'sentry-fixture/team'; import {UserFixture} from 'sentry-fixture/user'; @@ -32,7 +33,9 @@ describe('UpdatedGroupHeader', () => { teams: [TeamFixture()], }); const group = GroupFixture({issueCategory: IssueCategory.ERROR, isUnhandled: true}); - const location = LocationFixture({query: {streamline: '1'}}); + const router = RouterFixture({ + location: LocationFixture({query: {streamline: '1'}}), + }); describe('JS Project Error Issue', () => { const defaultProps = { @@ -109,7 +112,7 @@ describe('UpdatedGroupHeader', () => { />, { organization, - router: {location}, + router, } ); @@ -159,7 +162,7 @@ describe('UpdatedGroupHeader', () => { , { organization, - router: {location}, + router, } ); expect( @@ -180,7 +183,7 @@ describe('UpdatedGroupHeader', () => { , { organization: flaggedOrganization, - router: {location}, + router, } ); expect( diff --git a/static/app/views/issueDetails/useGroupDetailsRoute.tsx b/static/app/views/issueDetails/useGroupDetailsRoute.tsx index 2e54051d11c830..2fc989fdd6177a 100644 --- a/static/app/views/issueDetails/useGroupDetailsRoute.tsx +++ b/static/app/views/issueDetails/useGroupDetailsRoute.tsx @@ -16,7 +16,7 @@ function getCurrentTab({router}: {router: RouteProps['router']}) { return Tab.TAGS; } return ( - Object.values(Tab).find(tab => currentRoute.path === TabPaths[tab]) ?? Tab.DETAILS + Object.values(Tab).find(tab => currentRoute?.path === TabPaths[tab]) ?? Tab.DETAILS ); }