Skip to content

Commit 0f2bd7f

Browse files
authored
fix(issues): Fix phrasing for single ownership issue (#68493)
"There were 1 ownership issues" -> "There was 1 ownership issue"
1 parent 05ff01b commit 0f2bd7f

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

static/app/views/settings/project/projectOwnership/codeownerErrors.spec.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@ describe('CodeownerErrors', () => {
1010
const project = ProjectFixture();
1111
const org = OrganizationFixture();
1212

13+
it('should render error', async () => {
14+
const codeowner = CodeOwnerFixture({
15+
errors: {
16+
missing_user_emails: [],
17+
missing_external_users: [],
18+
missing_external_teams: ['@getsentry/something'],
19+
teams_without_access: [],
20+
users_without_access: [],
21+
},
22+
});
23+
render(
24+
<CodeOwnerErrors
25+
codeowners={[codeowner]}
26+
projectSlug={project.slug}
27+
orgSlug={org.slug}
28+
/>
29+
);
30+
31+
await userEvent.click(
32+
screen.getByText(
33+
'There was 1 ownership issue within Sentry on the latest sync with the CODEOWNERS file'
34+
)
35+
);
36+
expect(
37+
screen.getByText(`There’s a problem linking teams and members from an integration`)
38+
).toBeInTheDocument();
39+
expect(screen.getByText('@getsentry/something')).toBeInTheDocument();
40+
});
41+
1342
it('should render errors', async () => {
1443
const codeowner = CodeOwnerFixture({
1544
errors: {

static/app/views/settings/project/projectOwnership/codeownerErrors.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ export function CodeOwnerErrors({
172172
</AlertContentContainer>
173173
}
174174
>
175-
{`There were ${errorCount} ownership issues within Sentry on the latest sync with the CODEOWNERS file`}
175+
{errorCount === 1
176+
? `There was ${errorCount} ownership issue within Sentry on the latest sync with the CODEOWNERS file`
177+
: `There were ${errorCount} ownership issues within Sentry on the latest sync with the CODEOWNERS file`}
176178
</Alert>
177179
);
178180
})}

0 commit comments

Comments
 (0)