Browse Source

test(js): Drop project parameter in initializeOrg (#72728)

Evan Purkhiser 9 months ago
parent
commit
5d9e3296b8

+ 6 - 4
static/app/views/alerts/rules/issue/index.spec.tsx

@@ -158,7 +158,7 @@ describe('IssueRuleEditor', function () {
     it('is visible without org-level alerts:write', async () => {
       createWrapper({
         organization: {access: []},
-        project: {access: []},
+        projects: [{access: []}],
       });
 
       expect(await screen.findByText(permissionAlertText)).toBeInTheDocument();
@@ -168,7 +168,7 @@ describe('IssueRuleEditor', function () {
     it('is enabled with org-level alerts:write', async () => {
       createWrapper({
         organization: {access: ['alerts:write']},
-        project: {access: []},
+        projects: [{access: []}],
       });
 
       expect(await screen.findByLabelText('Save Rule')).toBeEnabled();
@@ -178,7 +178,7 @@ describe('IssueRuleEditor', function () {
     it('is enabled with project-level alerts:write', async () => {
       createWrapper({
         organization: {access: []},
-        project: {access: ['alerts:write']},
+        projects: [{access: ['alerts:write']}],
       });
 
       expect(await screen.findByLabelText('Save Rule')).toBeEnabled();
@@ -361,7 +361,9 @@ describe('IssueRuleEditor', function () {
     });
 
     it('renders environment selector in adopted release filter', async function () {
-      createWrapper({project: ProjectFixture({environments: ['production', 'staging']})});
+      createWrapper({
+        projects: [ProjectFixture({environments: ['production', 'staging']})],
+      });
 
       // Add the adopted release filter
       await selectEvent.select(

+ 1 - 5
tests/js/sentry-test/initializeOrg.tsx

@@ -34,14 +34,10 @@ interface InitializeOrgOptions<RouterParams> {
  */
 export function initializeOrg<RouterParams = {orgId: string; projectId: string}>({
   organization: additionalOrg,
-  project: additionalProject,
   projects: additionalProjects,
   router: additionalRouter,
 }: InitializeOrgOptions<RouterParams> = {}) {
-  const projects = (
-    additionalProjects ||
-    (additionalProject && [additionalProject]) || [{}]
-  ).map(p => ProjectFixture(p));
+  const projects = (additionalProjects || [{}]).map(p => ProjectFixture(p));
 
   const [project] = projects;
   const organization = OrganizationFixture({