Browse Source

ref(js): Convert errorRobot.spec to tsx (#51112)

Evan Purkhiser 1 year ago
parent
commit
610adba3e1
1 changed files with 7 additions and 13 deletions
  1. 7 13
      static/app/components/errorRobot.spec.tsx

+ 7 - 13
static/app/components/errorRobot.spec.jsx → static/app/components/errorRobot.spec.tsx

@@ -1,15 +1,14 @@
 import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
 
-import {Client} from 'sentry/api';
 import ErrorRobot from 'sentry/components/errorRobot';
 
 describe('ErrorRobot', function () {
-  let getIssues;
+  let getIssues: jest.Func;
   let routerContext;
 
   beforeEach(function () {
     routerContext = TestStubs.routerContext();
-    getIssues = Client.addMockResponse({
+    getIssues = MockApiClient.addMockResponse({
       url: '/projects/org-slug/project-slug/issues/',
       method: 'GET',
       body: [],
@@ -18,17 +17,13 @@ describe('ErrorRobot', function () {
 
   afterEach(() => {
     jest.clearAllMocks();
-    Client.clearMockResponses();
+    MockApiClient.clearMockResponses();
   });
 
   describe('with a project', function () {
     function createWrapper() {
       return render(
-        <ErrorRobot
-          api={new MockApiClient()}
-          org={TestStubs.Organization()}
-          project={TestStubs.Project()}
-        />,
+        <ErrorRobot org={TestStubs.Organization()} project={TestStubs.Project()} />,
         {context: routerContext}
       );
     }
@@ -51,10 +46,9 @@ describe('ErrorRobot', function () {
 
   describe('without a project', function () {
     function createWrapper() {
-      return render(
-        <ErrorRobot api={new MockApiClient()} org={TestStubs.Organization()} />,
-        {context: routerContext}
-      );
+      return render(<ErrorRobot org={TestStubs.Organization()} />, {
+        context: routerContext,
+      });
     }
 
     it('Renders a disabled create event button', function () {