Skip to content

Commit 3664576

Browse files
committed
test(checkout): Query the native Seer checkbox
1 parent 2d91dd9 commit 3664576

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎static/gsApp/views/amCheckout/index.spec.tsx‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ import {BillingConfigFixture} from 'getsentry-test/fixtures/billingConfig';
66
import {MetricHistoryFixture} from 'getsentry-test/fixtures/metricHistory';
77
import {SubscriptionFixture} from 'getsentry-test/fixtures/subscription';
88
import {PlanTier} from 'getsentry-test/planTier';
9-
import {act, render, screen, userEvent, waitFor} from 'sentry-test/reactTestingLibrary';
9+
import {
10+
act,
11+
render,
12+
screen,
13+
userEvent,
14+
waitFor,
15+
within,
16+
} from 'sentry-test/reactTestingLibrary';
1017

1118
import {SubscriptionStore} from 'getsentry/stores/subscriptionStore';
1219
import {AddOnCategory, OnDemandBudgetMode} from 'getsentry/types';
@@ -15,10 +22,9 @@ import {getCheckoutAPIData} from 'getsentry/views/amCheckout/utils';
1522
import {hasOnDemandBudgetsFeature} from 'getsentry/views/spendLimits/utils';
1623

1724
function getSeerOption() {
18-
const optionText = screen.getByText(/\/ active contributor \/ month/);
19-
const option = optionText.closest('[role="checkbox"]');
20-
expect(option).toBeInTheDocument();
21-
return option!;
25+
return within(screen.getByTestId(`product-option-${AddOnCategory.SEER}`)).getByRole(
26+
'checkbox'
27+
);
2228
}
2329

2430
async function assertCheckoutSteps({

0 commit comments

Comments
 (0)