Skip to content

Commit d415147

Browse files
committed
tests
1 parent 312cc06 commit d415147

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

static/app/views/organizationStats/index.spec.tsx

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,9 @@ describe('OrganizationStats', () => {
545545
).not.toBeInTheDocument();
546546
});
547547

548-
it('shows Metrics category when tracemetrics-enabled feature flag is enabled', async () => {
548+
it('shows Metrics category when tracemetrics-enabled and explore-dev-features flags are enabled', async () => {
549549
const newOrg = OrganizationFixture({
550-
features: ['team-insights', 'tracemetrics-enabled'],
550+
features: ['team-insights', 'tracemetrics-enabled', 'explore-dev-features'],
551551
});
552552

553553
render(<OrganizationStats />, {
@@ -558,6 +558,47 @@ describe('OrganizationStats', () => {
558558
expect(screen.getByRole('option', {name: 'Metrics'})).toBeInTheDocument();
559559
});
560560

561+
it('does not show Metrics category without explore-dev-features flag', async () => {
562+
const newOrg = OrganizationFixture({
563+
features: ['team-insights', 'tracemetrics-enabled'],
564+
});
565+
566+
render(<OrganizationStats />, {
567+
organization: newOrg,
568+
});
569+
570+
await userEvent.click(await screen.findByText('Category'));
571+
expect(screen.queryByRole('option', {name: 'Metrics'})).not.toBeInTheDocument();
572+
});
573+
574+
it('shows Application Metrics category when tracemetrics-stats-bytes-ui flag is enabled', async () => {
575+
const newOrg = OrganizationFixture({
576+
features: ['team-insights', 'tracemetrics-enabled', 'tracemetrics-stats-bytes-ui'],
577+
});
578+
579+
render(<OrganizationStats />, {
580+
organization: newOrg,
581+
});
582+
583+
await userEvent.click(await screen.findByText('Category'));
584+
expect(screen.getByRole('option', {name: 'Application Metrics'})).toBeInTheDocument();
585+
});
586+
587+
it('does not show Application Metrics category without tracemetrics-stats-bytes-ui flag', async () => {
588+
const newOrg = OrganizationFixture({
589+
features: ['team-insights', 'tracemetrics-enabled'],
590+
});
591+
592+
render(<OrganizationStats />, {
593+
organization: newOrg,
594+
});
595+
596+
await userEvent.click(await screen.findByText('Category'));
597+
expect(
598+
screen.queryByRole('option', {name: 'Application Metrics'})
599+
).not.toBeInTheDocument();
600+
});
601+
561602
it('denies access on no projects', async () => {
562603
act(() => ProjectsStore.loadInitialData([]));
563604

0 commit comments

Comments
 (0)