Browse Source

ref(tsc): convert index.spec to tsx (#52706)

Convert index.spec to tsx
Jonas 1 year ago
parent
commit
0aacf59f48

+ 4 - 6
static/app/views/dashboards/manage/index.spec.jsx → static/app/views/dashboards/manage/index.spec.tsx

@@ -44,9 +44,8 @@ describe('Dashboards > Detail', function () {
   it('denies access on missing feature', function () {
     render(
       <ManageDashboards
+        {...TestStubs.routeComponentProps()}
         organization={mockUnauthorizedOrg}
-        location={{query: {}}}
-        router={{}}
       />
     );
 
@@ -58,9 +57,8 @@ describe('Dashboards > Detail', function () {
 
     render(
       <ManageDashboards
+        {...TestStubs.routeComponentProps()}
         organization={mockAuthorizedOrg}
-        location={{query: {}}}
-        router={{}}
       />
     );
 
@@ -72,7 +70,7 @@ describe('Dashboards > Detail', function () {
   it('creates new dashboard', async function () {
     const org = TestStubs.Organization({features: FEATURES});
 
-    render(<ManageDashboards organization={org} location={{query: {}}} router={{}} />);
+    render(<ManageDashboards {...TestStubs.routeComponentProps()} organization={org} />);
 
     await userEvent.click(screen.getByTestId('dashboard-create'));
 
@@ -85,7 +83,7 @@ describe('Dashboards > Detail', function () {
   it('can sort', async function () {
     const org = TestStubs.Organization({features: FEATURES});
 
-    render(<ManageDashboards organization={org} location={{query: {}}} router={{}} />);
+    render(<ManageDashboards {...TestStubs.routeComponentProps()} organization={org} />);
 
     await selectEvent.select(
       screen.getByRole('button', {name: /sort by/i}),

+ 1 - 0
static/app/views/dashboards/manage/index.tsx

@@ -1,5 +1,6 @@
 import {browserHistory, InjectedRouter} from 'react-router';
 import styled from '@emotion/styled';
+import {Location} from 'history';
 import pick from 'lodash/pick';
 
 import {createDashboard} from 'sentry/actionCreators/dashboards';