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

fix(issues): Fix phrasing for single ownership issue (#68493)

"There were 1 ownership issues" -> "There was 1 ownership issue"
Matt Duncan 11 месяцев назад
Родитель
Сommit
0f2bd7f382

+ 29 - 0
static/app/views/settings/project/projectOwnership/codeownerErrors.spec.tsx

@@ -10,6 +10,35 @@ describe('CodeownerErrors', () => {
   const project = ProjectFixture();
   const org = OrganizationFixture();
 
+  it('should render error', async () => {
+    const codeowner = CodeOwnerFixture({
+      errors: {
+        missing_user_emails: [],
+        missing_external_users: [],
+        missing_external_teams: ['@getsentry/something'],
+        teams_without_access: [],
+        users_without_access: [],
+      },
+    });
+    render(
+      <CodeOwnerErrors
+        codeowners={[codeowner]}
+        projectSlug={project.slug}
+        orgSlug={org.slug}
+      />
+    );
+
+    await userEvent.click(
+      screen.getByText(
+        'There was 1 ownership issue within Sentry on the latest sync with the CODEOWNERS file'
+      )
+    );
+    expect(
+      screen.getByText(`There’s a problem linking teams and members from an integration`)
+    ).toBeInTheDocument();
+    expect(screen.getByText('@getsentry/something')).toBeInTheDocument();
+  });
+
   it('should render errors', async () => {
     const codeowner = CodeOwnerFixture({
       errors: {

+ 3 - 1
static/app/views/settings/project/projectOwnership/codeownerErrors.tsx

@@ -172,7 +172,9 @@ export function CodeOwnerErrors({
               </AlertContentContainer>
             }
           >
-            {`There were ${errorCount} ownership issues within Sentry on the latest sync with the CODEOWNERS file`}
+            {errorCount === 1
+              ? `There was ${errorCount} ownership issue within Sentry on the latest sync with the CODEOWNERS file`
+              : `There were ${errorCount} ownership issues within Sentry on the latest sync with the CODEOWNERS file`}
           </Alert>
         );
       })}