Просмотр исходного кода

ref(ts): Convert projectSecurityHeaders/index.spec to tsx (#52019)

Evan Purkhiser 1 год назад
Родитель
Сommit
970ced1473
1 измененных файлов с 3 добавлено и 11 удалено
  1. 3 11
      static/app/views/settings/projectSecurityHeaders/index.spec.tsx

+ 3 - 11
static/app/views/settings/projectSecurityHeaders/index.spec.jsx → static/app/views/settings/projectSecurityHeaders/index.spec.tsx

@@ -1,11 +1,10 @@
+import {initializeOrg} from 'sentry-test/initializeOrg';
 import {render} from 'sentry-test/reactTestingLibrary';
 import {render} from 'sentry-test/reactTestingLibrary';
 
 
 import ProjectSecurityHeaders from 'sentry/views/settings/projectSecurityHeaders';
 import ProjectSecurityHeaders from 'sentry/views/settings/projectSecurityHeaders';
 
 
 describe('ProjectSecurityHeaders', function () {
 describe('ProjectSecurityHeaders', function () {
-  const org = TestStubs.Organization();
-  const project = TestStubs.Project();
-  const url = `/projects/${org.slug}/${project.slug}/`;
+  const {organization: org, project, routerProps} = initializeOrg();
 
 
   beforeEach(function () {
   beforeEach(function () {
     MockApiClient.clearMockResponses();
     MockApiClient.clearMockResponses();
@@ -18,14 +17,7 @@ describe('ProjectSecurityHeaders', function () {
 
 
   it('renders', function () {
   it('renders', function () {
     const wrapper = render(
     const wrapper = render(
-      <ProjectSecurityHeaders
-        organization={org}
-        project={project}
-        {...TestStubs.routerProps({
-          params: {projectId: project.slug},
-          location: TestStubs.location({pathname: url}),
-        })}
-      />
+      <ProjectSecurityHeaders {...routerProps} organization={org} />
     );
     );
     expect(wrapper.container).toSnapshot();
     expect(wrapper.container).toSnapshot();
   });
   });