Browse Source

test(ui): Remove translations in tests (#77743)

No need to translate inside tests
Scott Cooper 5 months ago
parent
commit
2ea59b06b9

+ 3 - 4
static/app/components/discover/transactionsList.spec.tsx

@@ -3,7 +3,6 @@ import type {RenderResult} from 'sentry-test/reactTestingLibrary';
 import {render, screen, userEvent, waitFor} from 'sentry-test/reactTestingLibrary';
 
 import TransactionsList from 'sentry/components/discover/transactionsList';
-import {t} from 'sentry/locale';
 import EventView from 'sentry/utils/discover/eventView';
 import {MEPSettingProvider} from 'sentry/utils/performance/contexts/metricsEnhancedSetting';
 import {OrganizationContext} from 'sentry/views/organizationContext';
@@ -60,12 +59,12 @@ describe('TransactionsList', function () {
         {
           sort: {kind: 'asc', field: 'transaction'},
           value: 'name',
-          label: t('Transactions'),
+          label: 'Transactions',
         },
         {
           sort: {kind: 'desc', field: 'count'},
           value: 'count',
-          label: t('Failing Transactions'),
+          label: 'Failing Transactions',
         },
       ];
       generateLink = {
@@ -185,7 +184,7 @@ describe('TransactionsList', function () {
       options.push({
         sort: {kind: 'desc', field: 'trend_percentage()'},
         value: 'regression',
-        label: t('Trending Regressions'),
+        label: 'Trending Regressions',
         trendType: 'regression',
       });
       render(

+ 1 - 2
static/app/components/modals/dashboardWidgetQuerySelectorModal.spec.tsx

@@ -2,7 +2,6 @@ import {initializeOrg} from 'sentry-test/initializeOrg';
 import {render, screen} from 'sentry-test/reactTestingLibrary';
 
 import DashboardWidgetQuerySelectorModal from 'sentry/components/modals/dashboardWidgetQuerySelectorModal';
-import {t} from 'sentry/locale';
 import {DisplayType} from 'sentry/views/dashboards/types';
 
 const stubEl: any = (props: any) => <div>{props.children}</div>;
@@ -73,7 +72,7 @@ describe('Modals -> AddDashboardWidgetModal', function () {
     });
     MockApiClient.addMockResponse({
       url: '/organizations/org-slug/dashboards/',
-      body: [{id: '1', title: t('Test Dashboard')}],
+      body: [{id: '1', title: 'Test Dashboard'}],
     });
   });
 

+ 3 - 4
static/app/views/insights/common/views/spanSummaryPage/sampleList/sampleTable/sampleTable.spec.tsx

@@ -5,7 +5,6 @@ import {
 } from 'sentry-test/reactTestingLibrary';
 
 import {COL_WIDTH_UNDEFINED} from 'sentry/components/gridEditable';
-import {t} from 'sentry/locale';
 import type {PageFilters} from 'sentry/types/core';
 import {ModuleName, SpanMetricsField} from 'sentry/views/insights/types';
 
@@ -98,17 +97,17 @@ describe('SampleTable', function () {
           columnOrder={[
             {
               key: 'transaction_id',
-              name: t('Event ID'),
+              name: 'Event ID',
               width: COL_WIDTH_UNDEFINED,
             },
             {
               key: 'profile_id',
-              name: t('Profile'),
+              name: 'Profile',
               width: COL_WIDTH_UNDEFINED,
             },
             {
               key: 'avg_comparison',
-              name: t('Compared to Average'),
+              name: 'Compared to Average',
               width: COL_WIDTH_UNDEFINED,
             },
           ]}

+ 6 - 7
static/app/views/performance/transactionSummary/transactionEvents/eventsTable.spec.tsx

@@ -3,7 +3,6 @@ import {OrganizationFixture} from 'sentry-fixture/organization';
 import {initializeOrg} from 'sentry-test/initializeOrg';
 import {render, screen, waitForElementToBeRemoved} from 'sentry-test/reactTestingLibrary';
 
-import {t} from 'sentry/locale';
 import ProjectsStore from 'sentry/stores/projectsStore';
 import EventView from 'sentry/utils/discover/eventView';
 import {
@@ -82,12 +81,12 @@ function initializeData({features: additionalFeatures = []}: Data = {}) {
 
 describe('Performance GridEditable Table', function () {
   const transactionsListTitles = [
-    t('event id'),
-    t('user'),
-    t('operation duration'),
-    t('total duration'),
-    t('trace id'),
-    t('timestamp'),
+    'event id',
+    'user',
+    'operation duration',
+    'total duration',
+    'trace id',
+    'timestamp',
   ];
   let fields = EVENTS_TABLE_RESPONSE_FIELDS;
   const organization = OrganizationFixture();

+ 16 - 17
static/app/views/settings/project/loaderScript.spec.tsx

@@ -8,7 +8,6 @@ import {
   waitForElementToBeRemoved,
 } from 'sentry-test/reactTestingLibrary';
 
-import {t} from 'sentry/locale';
 import type {Organization} from 'sentry/types/organization';
 import type {Project, ProjectKey} from 'sentry/types/project';
 import LoaderScript from 'sentry/views/settings/project/loaderScript';
@@ -172,24 +171,24 @@ describe('LoaderScript', function () {
 
     await waitForElementToBeRemoved(() => screen.queryByTestId('loading-indicator'));
 
-    expect(screen.getByText(t('Enable Performance Monitoring'))).toBeInTheDocument();
-    expect(screen.getByText(t('Enable Session Replay'))).toBeInTheDocument();
-    expect(screen.getByText(t('Enable Debug Bundles & Logging'))).toBeInTheDocument();
+    expect(screen.getByText('Enable Performance Monitoring')).toBeInTheDocument();
+    expect(screen.getByText('Enable Session Replay')).toBeInTheDocument();
+    expect(screen.getByText('Enable Debug Bundles & Logging')).toBeInTheDocument();
 
     let performanceCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Performance Monitoring'),
+      name: 'Enable Performance Monitoring',
     });
     expect(performanceCheckbox).toBeEnabled();
     expect(performanceCheckbox).not.toBeChecked();
 
     const replayCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Session Replay'),
+      name: 'Enable Session Replay',
     });
     expect(replayCheckbox).toBeEnabled();
     expect(replayCheckbox).toBeChecked();
 
     const debugCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Debug Bundles & Logging'),
+      name: 'Enable Debug Bundles & Logging',
     });
     expect(debugCheckbox).toBeEnabled();
     expect(debugCheckbox).not.toBeChecked();
@@ -197,12 +196,12 @@ describe('LoaderScript', function () {
     // Toggle performance option
     await userEvent.click(
       screen.getByRole('checkbox', {
-        name: t('Enable Performance Monitoring'),
+        name: 'Enable Performance Monitoring',
       })
     );
 
     performanceCheckbox = await screen.findByRole('checkbox', {
-      name: t('Enable Performance Monitoring'),
+      name: 'Enable Performance Monitoring',
       checked: true,
     });
     expect(performanceCheckbox).toBeEnabled();
@@ -285,19 +284,19 @@ describe('LoaderScript', function () {
 
     expect(
       screen.getAllByRole('checkbox', {
-        name: t('Enable Performance Monitoring'),
+        name: 'Enable Performance Monitoring',
         checked: false,
       })
     ).toHaveLength(2);
     expect(
       screen.getAllByRole('checkbox', {
-        name: t('Enable Session Replay'),
+        name: 'Enable Session Replay',
         checked: false,
       })
     ).toHaveLength(2);
     expect(
       screen.getAllByRole('checkbox', {
-        name: t('Enable Debug Bundles & Logging'),
+        name: 'Enable Debug Bundles & Logging',
         checked: false,
       })
     ).toHaveLength(2);
@@ -305,32 +304,32 @@ describe('LoaderScript', function () {
     // Toggle performance option
     await userEvent.click(
       screen.getAllByRole('checkbox', {
-        name: t('Enable Performance Monitoring'),
+        name: 'Enable Performance Monitoring',
       })[1]
     );
 
     expect(
       await screen.findByRole('checkbox', {
-        name: t('Enable Performance Monitoring'),
+        name: 'Enable Performance Monitoring',
         checked: true,
       })
     ).toBeInTheDocument();
 
     expect(
       screen.getByRole('checkbox', {
-        name: t('Enable Performance Monitoring'),
+        name: 'Enable Performance Monitoring',
         checked: false,
       })
     ).toBeInTheDocument();
     expect(
       screen.getAllByRole('checkbox', {
-        name: t('Enable Session Replay'),
+        name: 'Enable Session Replay',
         checked: false,
       })
     ).toHaveLength(2);
     expect(
       screen.getAllByRole('checkbox', {
-        name: t('Enable Debug Bundles & Logging'),
+        name: 'Enable Debug Bundles & Logging',
         checked: false,
       })
     ).toHaveLength(2);

+ 10 - 11
static/app/views/settings/project/projectKeys/details/loaderSettings.spec.tsx

@@ -4,7 +4,6 @@ import {initializeOrg} from 'sentry-test/initializeOrg';
 import {render, screen, userEvent, waitFor} from 'sentry-test/reactTestingLibrary';
 import selectEvent from 'sentry-test/selectEvent';
 
-import {t} from 'sentry/locale';
 import type {Organization} from 'sentry/types/organization';
 import type {Project, ProjectKey} from 'sentry/types/project';
 
@@ -71,24 +70,24 @@ describe('Loader Script Settings', function () {
     // Panel title
     expect(screen.getByText('JavaScript Loader Script')).toBeInTheDocument();
 
-    expect(screen.getByText(t('Enable Performance Monitoring'))).toBeInTheDocument();
-    expect(screen.getByText(t('Enable Session Replay'))).toBeInTheDocument();
-    expect(screen.getByText(t('Enable Debug Bundles & Logging'))).toBeInTheDocument();
+    expect(screen.getByText('Enable Performance Monitoring')).toBeInTheDocument();
+    expect(screen.getByText('Enable Session Replay')).toBeInTheDocument();
+    expect(screen.getByText('Enable Debug Bundles & Logging')).toBeInTheDocument();
 
     const performanceCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Performance Monitoring'),
+      name: 'Enable Performance Monitoring',
     });
     expect(performanceCheckbox).toBeEnabled();
     expect(performanceCheckbox).not.toBeChecked();
 
     const replayCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Session Replay'),
+      name: 'Enable Session Replay',
     });
     expect(replayCheckbox).toBeEnabled();
     expect(replayCheckbox).toBeChecked();
 
     const debugCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Debug Bundles & Logging'),
+      name: 'Enable Debug Bundles & Logging',
     });
     expect(debugCheckbox).toBeEnabled();
     expect(debugCheckbox).not.toBeChecked();
@@ -127,7 +126,7 @@ describe('Loader Script Settings', function () {
     // Toggle performance option
     await userEvent.click(
       screen.getByRole('checkbox', {
-        name: t('Enable Performance Monitoring'),
+        name: 'Enable Performance Monitoring',
       })
     );
 
@@ -236,17 +235,17 @@ describe('Loader Script Settings', function () {
     );
 
     const performanceCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Performance Monitoring'),
+      name: 'Enable Performance Monitoring',
     });
     expect(performanceCheckbox).not.toBeChecked();
 
     const replayCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Session Replay'),
+      name: 'Enable Session Replay',
     });
     expect(replayCheckbox).not.toBeChecked();
 
     const debugCheckbox = screen.getByRole('checkbox', {
-      name: t('Enable Debug Bundles & Logging'),
+      name: 'Enable Debug Bundles & Logging',
     });
     expect(debugCheckbox).toBeChecked();