Browse Source

ref: Replace ProjectDetails fixture with Project fixture (#55741)

Ryan Albrecht 1 year ago
parent
commit
7aeaf628fc

+ 0 - 24
fixtures/js-stubs/projectDetails.js

@@ -1,24 +0,0 @@
-import {Project} from './project';
-
-export function ProjectDetails(params = {}) {
-  return Project({
-    subjectTemplate: '[$project] ${tag:level}: $title',
-    subjectPrefix: '[my-org]',
-    digestsMinDelay: 5,
-    digestsMaxDelay: 60,
-    dataScrubber: false,
-    dataScrubberDefaults: false,
-    scrubIPAddresses: false,
-    resolveAge: 48,
-    sensitiveFields: ['creditcard', 'ssn'],
-    safeFields: ['business-email', 'company'],
-    storeCrashReports: false,
-    allowedDomains: ['example.com', 'https://example.com'],
-    scrapeJavaScript: true,
-    securityToken: 'security-token',
-    securityTokenHeader: 'x-security-header',
-    verifySSL: true,
-    features: [],
-    ...params,
-  });
-}

+ 1 - 1
static/app/components/issueDiff/index.spec.tsx

@@ -7,7 +7,7 @@ jest.mock('sentry/api');
 describe('IssueDiff', function () {
   const entries = TestStubs.Entries();
   const api = new MockApiClient();
-  const project = TestStubs.ProjectDetails();
+  const project = TestStubs.Project();
 
   beforeEach(function () {
     MockApiClient.addMockResponse({

+ 1 - 1
static/app/components/modals/diffModal.spec.tsx

@@ -6,7 +6,7 @@ import DiffModal from 'sentry/components/modals/diffModal';
 
 describe('DiffModal', function () {
   it('renders', function () {
-    const project = TestStubs.ProjectDetails();
+    const project = TestStubs.Project();
     MockApiClient.addMockResponse({
       url: '/issues/123/events/latest/',
       body: {

+ 3 - 3
static/app/utils/eventWaiter.spec.tsx

@@ -7,7 +7,7 @@ jest.useFakeTimers();
 describe('EventWaiter', function () {
   it('waits for the first projet event', async function () {
     const org = TestStubs.Organization();
-    const project = TestStubs.ProjectDetails({
+    const project = TestStubs.Project({
       firstEvent: null,
     });
 
@@ -73,7 +73,7 @@ describe('EventWaiter', function () {
 
   it('receives a first event of `true` when first even has expired', async function () {
     const org = TestStubs.Organization();
-    const project = TestStubs.ProjectDetails({
+    const project = TestStubs.Project({
       firstEvent: '2019-05-01T00:00:00.000Z',
     });
 
@@ -114,7 +114,7 @@ describe('EventWaiter', function () {
 
   it('does not poll when disabled', function () {
     const org = TestStubs.Organization();
-    const project = TestStubs.ProjectDetails();
+    const project = TestStubs.Project();
 
     const projectApiMock = MockApiClient.addMockResponse({
       url: `/projects/${org.slug}/${project.slug}/`,

+ 1 - 1
static/app/views/issueDetails/actions/index.spec.tsx

@@ -16,7 +16,7 @@ import {IssueCategory} from 'sentry/types';
 import * as analytics from 'sentry/utils/analytics';
 import GroupActions from 'sentry/views/issueDetails/actions';
 
-const project = TestStubs.ProjectDetails({
+const project = TestStubs.Project({
   id: '2448',
   name: 'project name',
   slug: 'project',

+ 2 - 2
static/app/views/issueList/overview.spec.tsx

@@ -28,7 +28,7 @@ const DEFAULT_LINKS_HEADER =
   '<http://127.0.0.1:8000/api/0/organizations/org-slug/issues/?cursor=1443575731:0:1>; rel="previous"; results="false"; cursor="1443575731:0:1", ' +
   '<http://127.0.0.1:8000/api/0/organizations/org-slug/issues/?cursor=1443575000:0:0>; rel="next"; results="true"; cursor="1443575000:0:0"';
 
-const project = TestStubs.ProjectDetails({
+const project = TestStubs.Project({
   id: '3559',
   name: 'Foo Project',
   slug: 'project-slug',
@@ -1386,7 +1386,7 @@ describe('IssueList', function () {
       });
 
       it('for multiple projects', function () {
-        const projectBar = TestStubs.ProjectDetails({
+        const projectBar = TestStubs.Project({
           id: '3560',
           name: 'Bar Project',
           slug: 'project-slug-bar',

+ 1 - 1
static/app/views/settings/project/projectOwnership/addCodeOwnerModal.spec.tsx

@@ -12,7 +12,7 @@ import {AddCodeOwnerModal} from 'sentry/views/settings/project/projectOwnership/
 
 describe('AddCodeOwnerModal', function () {
   const org = TestStubs.Organization({features: ['integrations-codeowners']});
-  const project = TestStubs.ProjectDetails();
+  const project = TestStubs.Project();
   const integration = TestStubs.GitHubIntegration();
   const repo = TestStubs.Repository({
     integrationId: integration.id,

+ 1 - 1
static/app/views/settings/project/projectOwnership/modal.spec.tsx

@@ -6,7 +6,7 @@ import ProjectOwnershipModal from './modal';
 
 describe('Project Ownership', () => {
   const org = TestStubs.Organization();
-  const project = TestStubs.ProjectDetails();
+  const project = TestStubs.Project();
   const issueId = '1234';
   const stacktrace = TestStubs.EventEntryStacktrace();
   const event = TestStubs.Event({

+ 9 - 1
static/app/views/settings/projectGeneralSettings/index.spec.tsx

@@ -26,7 +26,15 @@ function getField(role, name) {
 
 describe('projectGeneralSettings', function () {
   const org = TestStubs.Organization();
-  const project = TestStubs.ProjectDetails();
+  const project = TestStubs.Project({
+    subjectPrefix: '[my-org]',
+    resolveAge: 48,
+    allowedDomains: ['example.com', 'https://example.com'],
+    scrapeJavaScript: true,
+    securityToken: 'security-token',
+    securityTokenHeader: 'x-security-header',
+    verifySSL: true,
+  });
   const groupingConfigs = TestStubs.GroupingConfigs();
   let routerContext;
   let putMock;

+ 1 - 1
static/app/views/settings/projectPerformance/projectPerformance.spec.tsx

@@ -21,7 +21,7 @@ describe('projectPerformance', function () {
       'project-performance-settings-admin',
     ],
   });
-  const project = TestStubs.ProjectDetails();
+  const project = TestStubs.Project();
   const configUrl = '/projects/org-slug/project-slug/transaction-threshold/configure/';
   let getMock, postMock, deleteMock, performanceIssuesMock;
 

Some files were not shown because too many files changed in this diff