Skip to content

Commit 75ecdbe

Browse files
cleanup
1 parent 17539e6 commit 75ecdbe

File tree

4 files changed

+31
-138
lines changed

4 files changed

+31
-138
lines changed

static/gsApp/views/amCheckout/checkoutOverviewV2.spec.tsx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('CheckoutOverviewV2', function () {
100100
);
101101

102102
expect(screen.getByText('All Sentry Products')).toBeInTheDocument();
103-
expect(screen.getByTestId('seer-reserved')).toBeInTheDocument(); // .toHaveTextContent('Seer $216/yr'); TODO(seer): uncomment this once fixtures are updated with pricing schedule
103+
expect(screen.getByTestId('seer-reserved')).toHaveTextContent('Seer$216/yr');
104104
expect(screen.getByText('Total Annual Charges')).toBeInTheDocument();
105105
expect(screen.getByText('$312/yr')).toBeInTheDocument();
106106
expect(screen.getByTestId('additional-monthly-charge')).toHaveTextContent(
@@ -201,4 +201,34 @@ describe('CheckoutOverviewV2', function () {
201201

202202
expect(screen.queryByTestId('seer-reserved')).not.toBeInTheDocument();
203203
});
204+
205+
it('does not show seer when not included in formData', function () {
206+
const formData: CheckoutFormData = {
207+
plan: 'am3_team_auf',
208+
reserved: {
209+
errors: 100000,
210+
attachments: 25,
211+
replays: 50,
212+
spans: 10_000_000,
213+
monitorSeats: 1,
214+
profileDuration: 0,
215+
profileDurationUI: 0,
216+
uptime: 1,
217+
},
218+
onDemandMaxSpend: 5000,
219+
};
220+
221+
render(
222+
<CheckoutOverviewV2
223+
activePlan={teamPlanAnnual}
224+
billingConfig={billingConfig}
225+
formData={formData}
226+
onUpdate={jest.fn()}
227+
organization={organization}
228+
subscription={subscription}
229+
/>
230+
);
231+
232+
expect(screen.queryByTestId('seer-reserved')).not.toBeInTheDocument();
233+
});
204234
});

static/gsApp/views/amCheckout/checkoutOverviewV2.tsx

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ function CheckoutOverviewV2({activePlan, formData, onUpdate: _onUpdate}: Props)
4646
[formData.onDemandMaxSpend]
4747
);
4848

49-
// const hasSeerEnabled = !!formData.seerEnabled;
50-
// const hasSeerFeature = organization.features.includes('seer-billing');
51-
5249
const renderPlanDetails = () => {
5350
return (
5451
<PanelChild>
@@ -72,56 +69,6 @@ function CheckoutOverviewV2({activePlan, formData, onUpdate: _onUpdate}: Props)
7269
);
7370
};
7471

75-
// const renderAdditionalFeatureSummary = ({
76-
// featureKey,
77-
// featureEnabled,
78-
// featureAvailable,
79-
// title,
80-
// tooltipTitle,
81-
// priceCents,
82-
// }: {
83-
// featureAvailable: boolean;
84-
// featureEnabled: boolean;
85-
// featureKey: string;
86-
// priceCents: number;
87-
// title: string;
88-
// tooltipTitle: string;
89-
// }) => {
90-
// return (
91-
// featureAvailable &&
92-
// featureEnabled && (
93-
// <PanelChild data-test-id={`${featureKey}-summary`}>
94-
// <SpaceBetweenRow style={{alignItems: 'start'}}>
95-
// <Column>
96-
// <div style={{display: 'flex', alignItems: 'center', gap: space(1)}}>
97-
// <Title>
98-
// {title}
99-
// &nbsp;&nbsp;
100-
// <QuestionTooltip size="xs" title={tooltipTitle} />
101-
// </Title>
102-
// </div>
103-
// </Column>
104-
// <Column minWidth="150px" alignItems="end">
105-
// <Title>{`+${utils.displayPrice({cents: priceCents})}/mo`}</Title>
106-
// <Description>Additional usage billed separately</Description>
107-
// </Column>
108-
// </SpaceBetweenRow>
109-
// </PanelChild>
110-
// )
111-
// );
112-
// };
113-
114-
// const renderSeerSummary = () => {
115-
// return renderAdditionalFeatureSummary({
116-
// featureKey: 'seer',
117-
// featureEnabled: hasSeerEnabled,
118-
// featureAvailable: hasSeerFeature,
119-
// title: t('Sentry AI Agent'),
120-
// tooltipTitle: t('Additional Seer information.'),
121-
// priceCents: SEER_MONTHLY_PRICE_CENTS,
122-
// });
123-
// };
124-
12572
const renderPayAsYouGoBudget = (paygBudgetTotal: number) => {
12673
return (
12774
<PanelChild>

static/gsApp/views/amCheckout/steps/planSelect.tsx

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -238,88 +238,6 @@ function PlanSelect({
238238
);
239239
};
240240

241-
// const renderSeer = () => {
242-
// return renderAdditionalFeature({
243-
// featureKey: 'seer',
244-
// featureEnabled: seerIsEnabled,
245-
// featureAvailable: hasSeerFeature,
246-
// title: 'Add Seer, our AI Agent',
247-
// description: 'Insights and solutions to fix bugs faster',
248-
// icon: <SeerIcon size="lg" />,
249-
// priceCents: SEER_MONTHLY_PRICE_CENTS,
250-
// featureItems: ['Root Cause Analysis', 'Autofix PRs', 'AI Issue Priority'],
251-
// tooltipTitle: t('Additional Seer information.'),
252-
// isNew: true,
253-
// setFeatureEnabled: setSeerIsEnabled,
254-
// });
255-
// };
256-
257-
// const renderAdditionalFeature = ({
258-
// featureKey,
259-
// featureEnabled,
260-
// featureAvailable,
261-
// title,
262-
// description,
263-
// icon,
264-
// priceCents,
265-
// featureItems,
266-
// tooltipTitle,
267-
// isNew = false,
268-
// setFeatureEnabled,
269-
// }: {
270-
// description: string;
271-
// featureAvailable: boolean;
272-
// featureEnabled: boolean;
273-
// featureItems: string[];
274-
// featureKey: string;
275-
// icon: React.ReactNode;
276-
// priceCents: number;
277-
// setFeatureEnabled: (enabled: boolean) => void;
278-
// title: string;
279-
// tooltipTitle: string;
280-
// isNew?: boolean;
281-
// }) => {
282-
// return (
283-
// featureAvailable && (
284-
// <StepFooter data-test-id={`footer-${featureKey}`}>
285-
// <FeatureContainer>
286-
// <FeatureHeader>
287-
// {icon}
288-
// {title}
289-
// {isNew && <FeatureBadge type="new" variant="badge" />}
290-
// </FeatureHeader>
291-
// <FeatureDescription>{description}</FeatureDescription>
292-
// <FeatureList>
293-
// {featureItems.map((item, index) => (
294-
// <FeatureItem key={index}>{item}</FeatureItem>
295-
// ))}
296-
// </FeatureList>
297-
// <ButtonWrapper>
298-
// <Button
299-
// priority={'default'}
300-
// icon={featureEnabled ? <IconCheckmark /> : <IconAdd />}
301-
// onClick={() => {
302-
// // Update the UI state
303-
// setFeatureEnabled(!featureEnabled);
304-
// // Update the form data
305-
// onUpdate({...formData, [`${featureKey}Enabled`]: !featureEnabled});
306-
// }}
307-
// data-test-id={`${featureKey}-toggle-button`}
308-
// >
309-
// {featureEnabled
310-
// ? t('Added to plan')
311-
// : t('%s/mo', utils.displayPrice({cents: priceCents}))}
312-
// </Button>
313-
// </ButtonWrapper>
314-
// <div>
315-
// Extra usage requires PAYG <QuestionTooltip size="xs" title={tooltipTitle} />
316-
// </div>
317-
// </FeatureContainer>
318-
// </StepFooter>
319-
// )
320-
// );
321-
// };
322-
323241
const renderFooter = () => {
324242
const bizPlanContent = getContentForPlan('business', checkoutTier);
325243
let missingFeatures: string[] = [];

static/gsApp/views/amCheckout/utils.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ export function getReservedPriceCents({
249249

250250
Object.entries(selectedProducts ?? {}).forEach(([apiName, selectedProductData]) => {
251251
if (selectedProductData.enabled) {
252-
// TODO: replace this to use the pricing schedule once that's serialized on availableReservedBudgetTypes
253-
// This way, we can handle both annual and monthly prices
254252
const budgetTypeInfo =
255253
plan.availableReservedBudgetTypes[apiName as ReservedBudgetCategoryType];
256254
if (budgetTypeInfo) {

0 commit comments

Comments
 (0)