Skip to content

Commit f3e4991

Browse files
committed
Fix derived grouping test after ungating
1 parent 45b6ab7 commit f3e4991

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

static/app/views/settings/projectIssueGrouping/index.spec.tsx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import {initializeOrg} from 'sentry-test/initializeOrg';
22
import {render, screen} from 'sentry-test/reactTestingLibrary';
33

4-
import {isActiveSuperuser} from 'sentry/utils/isActiveSuperuser';
54
import ProjectIssueGrouping from 'sentry/views/settings/projectIssueGrouping';
65

7-
jest.mock('sentry/utils/isActiveSuperuser', () => ({
8-
isActiveSuperuser: jest.fn(),
9-
}));
10-
116
describe('projectIssueGrouping', () => {
127
const {organization, projects} = initializeOrg();
138
const project = projects[0]!;
@@ -47,34 +42,21 @@ describe('projectIssueGrouping', () => {
4742
).toBeInTheDocument();
4843
});
4944

50-
it('shows derived grouping enhancements only for superusers', async () => {
51-
// Mock the API response
45+
it('shows derived grouping enhancements', async () => {
5246
MockApiClient.addMockResponse({
5347
url: `/projects/${organization.slug}/${project.slug}/grouping-configs/`,
5448
body: [],
5549
});
5650

57-
// First render with a non-superuser
58-
const {rerender} = render(<ProjectIssueGrouping />, {
51+
render(<ProjectIssueGrouping />, {
5952
organization,
6053
outletContext: {project},
6154
});
6255

63-
// Verify the section is visible for non-superuser
6456
expect(await screen.findByText('Issue Grouping')).toBeInTheDocument();
6557
expect(screen.getByText(/Derived Grouping Enhancements/)).toBeInTheDocument();
6658
expect(
6759
screen.getByRole('textbox', {name: /Derived Grouping Enhancements/})
6860
).toBeDisabled();
69-
70-
// Re-render for superuser
71-
jest.mocked(isActiveSuperuser).mockReturnValue(true);
72-
rerender(<ProjectIssueGrouping />);
73-
74-
// Verify the section is visible for superuser
75-
expect(screen.getByText(/Derived Grouping Enhancements/)).toBeInTheDocument();
76-
expect(
77-
screen.getByRole('textbox', {name: /Derived Grouping Enhancements/})
78-
).toBeDisabled();
7961
});
8062
});

0 commit comments

Comments
 (0)