Browse Source

ref(tsc): convert dashboardList.spec to tsx (#52705)

<!-- Describe your PR here. -->



<!--

  Sentry employees and contractors can delete or ignore the following.

-->

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.
Jonas 1 year ago
parent
commit
9533ecd3db
1 changed files with 10 additions and 6 deletions
  1. 10 6
      static/app/views/dashboards/manage/dashboardList.spec.tsx

+ 10 - 6
static/app/views/dashboards/manage/dashboardList.spec.jsx → static/app/views/dashboards/manage/dashboardList.spec.tsx

@@ -10,7 +10,7 @@ import {
 
 import DashboardList from 'sentry/views/dashboards/manage/dashboardList';
 
-describe('Dashboards > DashboardList', function () {
+describe('Dashboards - DashboardList', function () {
   let dashboards, widgets, deleteMock, dashboardUpdateMock, createMock;
   const organization = TestStubs.Organization({
     features: ['global-views', 'dashboards-basic', 'dashboards-edit', 'discover-query'],
@@ -128,6 +128,7 @@ describe('Dashboards > DashboardList', function () {
   it('renders an empty list', function () {
     render(
       <DashboardList
+        onDashboardsChange={jest.fn()}
         organization={organization}
         dashboards={[]}
         pageLinks=""
@@ -141,6 +142,7 @@ describe('Dashboards > DashboardList', function () {
   it('renders dashboard list', function () {
     render(
       <DashboardList
+        onDashboardsChange={jest.fn()}
         organization={organization}
         dashboards={dashboards}
         pageLinks=""
@@ -155,6 +157,7 @@ describe('Dashboards > DashboardList', function () {
   it('returns landing page url for dashboards', function () {
     render(
       <DashboardList
+        onDashboardsChange={jest.fn()}
         organization={organization}
         dashboards={dashboards}
         pageLinks=""
@@ -176,10 +179,11 @@ describe('Dashboards > DashboardList', function () {
   it('persists global selection headers', function () {
     render(
       <DashboardList
+        onDashboardsChange={jest.fn()}
         organization={organization}
         dashboards={dashboards}
         pageLinks=""
-        location={{query: {statsPeriod: '7d'}}}
+        location={{...TestStubs.location(), query: {statsPeriod: '7d'}}}
       />,
       {context: routerContext}
     );
@@ -196,7 +200,7 @@ describe('Dashboards > DashboardList', function () {
         organization={organization}
         dashboards={dashboards}
         pageLinks=""
-        location={{query: {}}}
+        location={{...TestStubs.location(), query: {}}}
         onDashboardsChange={dashboardUpdateMock}
       />,
       {context: routerContext}
@@ -233,7 +237,7 @@ describe('Dashboards > DashboardList', function () {
         organization={organization}
         dashboards={singleDashboard}
         pageLinks=""
-        location={{query: {}}}
+        location={TestStubs.location()}
         onDashboardsChange={dashboardUpdateMock}
       />
     );
@@ -251,7 +255,7 @@ describe('Dashboards > DashboardList', function () {
         organization={organization}
         dashboards={dashboards}
         pageLinks=""
-        location={{query: {}}}
+        location={{...TestStubs.location(), query: {}}}
         onDashboardsChange={dashboardUpdateMock}
       />
     );
@@ -277,7 +281,7 @@ describe('Dashboards > DashboardList', function () {
         organization={organization}
         dashboards={dashboards}
         pageLinks=""
-        location={{query: {}}}
+        location={{...TestStubs.location(), query: {}}}
         onDashboardsChange={dashboardUpdateMock}
       />
     );