- {t('whatItDoes.body')} -
-{t('whoItsFor.body')}
-{t('notForYou.body1')}
-- {t('notForYou.body2')} -
-{t(`howToApply.${step}Body`)}
-- {t('ready.subtitle')} -
- {/* Primary here on purpose: the brand fill pops on the black - closer, while the hero stays secondary because its background - is that same fill. */} - -- {t('ready.disclaimer')} -
-{t('qrScannerOverlay.notSupportedWorking')}
-{t('qrScannerOverlay.notSupportedGetNotified')}
- > - ), - ctas: [{ text: t('qrScannerOverlay.getNotifiedCta'), shadowSize: '4', onClick: onNotifyMe }], - }, - [EModalType.WILL_BE_NOTIFIED]: { - tone: 'success', - title: t('qrScannerOverlay.titleWillBeNotified'), - description: t('qrScannerOverlay.willBeNotified', { qrName }), + description: t('qrScannerOverlay.notSupportedWorking'), ctas: [{ text: tCommon('close'), shadowSize: '4', onClick: onClose }], }, // A payload that is not an http(s) link is not one the user can be asked @@ -524,10 +511,6 @@ export default function QRScannerOverlay() { qrType={qrType} redirectTo={redirectTo} onClose={() => setIsModalOpen(false)} - onNotifyMe={() => { - setModalContent(EModalType.WILL_BE_NOTIFIED) - posthog.capture(ANALYTICS_EVENTS.QR_NOTIFY_ME_CLICKED, { qr_type: qrType }) - }} /> {isQRScannerOpen && ( diff --git a/src/components/Marketing/StarLp/__tests__/usePeanutCardCta.test.tsx b/src/components/Marketing/StarLp/__tests__/usePeanutCardCta.test.tsx index bba92a643b..be240c1a1a 100644 --- a/src/components/Marketing/StarLp/__tests__/usePeanutCardCta.test.tsx +++ b/src/components/Marketing/StarLp/__tests__/usePeanutCardCta.test.tsx @@ -1,12 +1,15 @@ -import { act, renderHook } from '@testing-library/react' +import { act, renderHook, waitFor } from '@testing-library/react' import type { MouseEvent } from 'react' import { STAR_LP_HREF } from '@/components/Marketing/StarLp/starLp.consts' import { usePeanutCardCta } from '../pages/usePeanutCardCta' +import { getRedirectUrl } from '@/utils/general.utils' const mockIntercept = jest.fn(() => false) const mockPush = jest.fn() // null = no AuthProvider mounted (the optional hook returns null there). -let mockAuth: { user: unknown; isFetchingUser: boolean } | null = null +let mockAuth: { user: unknown; isFetchingUser: boolean; fetchUser?: jest.Mock } | null = null +const mockClaim = jest.fn() +const callOrder: string[] = [] jest.mock('@/context/authContext', () => ({ useAuth: () => { throw new Error('useAuth must be used within an AuthProvider') @@ -14,15 +17,50 @@ jest.mock('@/context/authContext', () => ({ useOptionalAuth: () => mockAuth, })) jest.mock('@/hooks/useGuestStoreHandoff', () => ({ - useGuestStoreHandoff: () => ({ interceptGuestCta: mockIntercept, storeHandoffModal: null }), + useGuestStoreHandoff: () => ({ + interceptGuestCta: (handoff: { dest: string }) => { + callOrder.push('intercept') + return (mockIntercept as jest.Mock)(handoff) + }, + storeHandoffModal: null, + }), })) +jest.mock('@/components/Invites/badge-campaign-context', () => { + const actual = jest.requireActual('@/components/Invites/badge-campaign-context') + return { + ...actual, + queuePendingBadgeCampaigns: (...args: [string[], number]) => { + callOrder.push('queue') + return actual.queuePendingBadgeCampaigns(...args) + }, + } +}) +jest.mock('@/services/badge-campaigns', () => ({ + claimAndSettlePendingBadgeCampaigns: (...args: unknown[]) => mockClaim(...args), + isConfirmedBadgeCampaignClaim: (claim: { outcome: string }) => claim.outcome === 'awarded', +})) +jest.mock('@sentry/nextjs', () => ({ captureException: jest.fn() })) jest.mock('next/navigation', () => ({ useRouter: () => ({ push: mockPush }) })) jest.mock('posthog-js', () => ({ __esModule: true, default: { capture: jest.fn() } })) +const click = (result: { current: ReturnType{useTranslations('shhhhh.hero')('pitch')}
+/** Reads one card FAQ line through next-intl. */ +function CardFaqProbe() { + return{useTranslations('shhhhh.faq')('q1.question')}
} async function routeIntl(locale: Parameters