Browse Source

test(js): Remove `org` from initializeOrg return (#48049)

Evan Purkhiser 1 year ago
parent
commit
6c8ed4cfa7

+ 5 - 5
static/app/components/charts/eventsAreaChart.spec.jsx

@@ -10,20 +10,20 @@ jest.mock('sentry/components/charts/baseChart', () => {
 });
 
 describe('EventsChart with legend', function () {
-  const {router, org} = initializeOrg();
+  const {router, organization} = initializeOrg();
 
   beforeEach(function () {
     mockZoomRange(1543449600000, 1543708800000);
     MockApiClient.addMockResponse({
-      url: `/organizations/${org.slug}/releases/`,
+      url: `/organizations/${organization.slug}/releases/`,
       body: [],
     });
     MockApiClient.addMockResponse({
-      url: `/organizations/${org.slug}/releases/stats/`,
+      url: `/organizations/${organization.slug}/releases/stats/`,
       body: [],
     });
     MockApiClient.addMockResponse({
-      url: `/organizations/${org.slug}/events-stats/`,
+      url: `/organizations/${organization.slug}/events-stats/`,
       method: 'GET',
       body: {
         data: [
@@ -39,7 +39,7 @@ describe('EventsChart with legend', function () {
       <EventsChart
         api={new MockApiClient()}
         location={{query: {}}}
-        organization={org}
+        organization={organization}
         project={[]}
         environment={[]}
         period="14d"

+ 2 - 2
static/app/components/charts/eventsChart.spec.jsx

@@ -21,7 +21,7 @@ jest.mock(
 );
 
 describe('EventsChart', function () {
-  const {router, routerContext, org} = initializeOrg();
+  const {router, routerContext, organization} = initializeOrg();
 
   afterEach(() => {
     MockApiClient.clearMockResponses();
@@ -32,7 +32,7 @@ describe('EventsChart', function () {
       <EventsChart
         api={new MockApiClient()}
         location={{query: {}}}
-        organization={org}
+        organization={organization}
         project={[]}
         environment={[]}
         period="14d"

+ 3 - 3
static/app/components/search/sources/apiSource.spec.tsx

@@ -7,7 +7,7 @@ import {render, waitFor} from 'sentry-test/reactTestingLibrary';
 import {ApiSource} from 'sentry/components/search/sources/apiSource';
 
 describe('ApiSource', function () {
-  const {org, router} = initializeOrg();
+  const {organization, router} = initializeOrg();
   let orgsMock;
   let projectsMock;
   let teamsMock;
@@ -17,7 +17,7 @@ describe('ApiSource', function () {
 
   const defaultProps: ComponentProps<typeof ApiSource> = {
     query: '',
-    organization: org,
+    organization,
     router,
     location: router.location,
     routes: [],
@@ -207,7 +207,7 @@ describe('ApiSource', function () {
   it('render function is called with correct results', async function () {
     const mock = jest.fn().mockReturnValue(null);
     render(
-      <ApiSource {...defaultProps} organization={org} query="foo">
+      <ApiSource {...defaultProps} organization={organization} query="foo">
         {mock}
       </ApiSource>
     );

+ 3 - 3
static/app/views/alerts/utils/utils.spec.tsx

@@ -16,7 +16,7 @@ import {
 import {getIncidentDiscoverUrl} from 'sentry/views/alerts/utils/getIncidentDiscoverUrl';
 
 describe('Alert utils', function () {
-  const {org, projects} = initializeOrg();
+  const {organization, projects} = initializeOrg();
 
   const mockStats: IncidentStats = {
     eventStats: {
@@ -44,7 +44,7 @@ describe('Alert utils', function () {
       } as Incident;
 
       const to = getIncidentDiscoverUrl({
-        orgSlug: org.slug,
+        orgSlug: organization.slug,
         projects,
         incident,
         stats: mockStats,
@@ -79,7 +79,7 @@ describe('Alert utils', function () {
       } as Incident;
 
       const to = getIncidentDiscoverUrl({
-        orgSlug: org.slug,
+        orgSlug: organization.slug,
         projects,
         incident,
         stats: mockStats,

+ 1 - 1
static/app/views/settings/organizationIntegrations/integrationListDirectory.spec.jsx

@@ -13,7 +13,7 @@ describe('IntegrationListDirectory', function () {
     Client.clearMockResponses();
   });
 
-  const {org, routerContext} = initializeOrg();
+  const {organization: org, routerContext} = initializeOrg();
 
   describe('Renders view', function () {
     beforeEach(() => {

+ 4 - 4
static/app/views/settings/project/projectUserFeedback.spec.jsx

@@ -4,8 +4,8 @@ import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary';
 import ProjectUserFeedback from 'sentry/views/settings/project/projectUserFeedback';
 
 describe('ProjectUserFeedback', function () {
-  const {org, project, routerContext} = initializeOrg();
-  const url = `/projects/${org.slug}/${project.slug}/`;
+  const {organization, project, routerContext} = initializeOrg();
+  const url = `/projects/${organization.slug}/${project.slug}/`;
 
   beforeEach(function () {
     MockApiClient.clearMockResponses();
@@ -24,9 +24,9 @@ describe('ProjectUserFeedback', function () {
   it('can toggle sentry branding option', async function () {
     render(
       <ProjectUserFeedback
-        organizatigon={org}
+        organizatigon={organization}
         project={project}
-        params={{orgId: org.slug, projectId: project.slug}}
+        params={{orgId: organization.slug, projectId: project.slug}}
       />,
       {context: routerContext}
     );

+ 4 - 4
static/app/views/settings/projectSecurityHeaders/expectCt.spec.tsx

@@ -4,13 +4,13 @@ import {render} from 'sentry-test/reactTestingLibrary';
 import ProjectExpectCtReports from 'sentry/views/settings/projectSecurityHeaders/expectCt';
 
 describe('ProjectExpectCtReports', function () {
-  const {router, org, project} = initializeOrg();
-  const url = `/projects/${org.slug}/${project.slug}/expect-ct/`;
+  const {router, organization, project} = initializeOrg();
+  const url = `/projects/${organization.slug}/${project.slug}/expect-ct/`;
 
   beforeEach(function () {
     MockApiClient.clearMockResponses();
     MockApiClient.addMockResponse({
-      url: `/projects/${org.slug}/${project.slug}/keys/`,
+      url: `/projects/${organization.slug}/${project.slug}/keys/`,
       method: 'GET',
       body: [],
     });
@@ -25,7 +25,7 @@ describe('ProjectExpectCtReports', function () {
         routes={router.routes}
         params={{projectId: project.slug}}
         location={TestStubs.location({pathname: url})}
-        organization={org}
+        organization={organization}
       />
     );
 

+ 0 - 1
tests/js/sentry-test/initializeOrg.jsx

@@ -40,7 +40,6 @@ export function initializeOrg({
   ]);
 
   return {
-    org: organization,
     organization,
     project,
     projects,