Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/Invites/campaign-maps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ describe('classifyBareCampaign', () => {
})
})

// Regression: both country-launch cohorts ship BARE links with no inviter.
// Mapping them in UTM_CAMPAIGN_TO_BADGE_MAP alone is not enough — without a
// bare-campaign registration the link dead-ends on "Invalid Invite Code".
it.each(['naija', 'terere'])('country-launch campaign "%s" is a bare claimable skip', (c) => {
expect(classifyBareCampaign(c, undefined)).toEqual({
isBareClaimCampaign: true,
isWaitlistSkip: true,
})
expect(classifyBareCampaign(c.toUpperCase(), undefined).isBareClaimCampaign).toBe(true)
})

it('only waitlist-skip campaigns promise a card-waitlist skip', () => {
for (const c of BARE_VANITY_CAMPAIGNS) {
expect(classifyBareCampaign(c, undefined).isWaitlistSkip).toBe(false)
Expand Down
7 changes: 6 additions & 1 deletion src/components/Invites/campaign-maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ export function resolveCampaign(
// - Vanity: a commemorative badge with NO card-waitlist skip. Claimable from a
// bare link, but `/invite` shows generic badge-claim copy (not "skip").
export const SKIP_CAMPAIGN = 'skip'
export const WAITLIST_SKIP_CAMPAIGNS: ReadonlySet<string> = new Set([SKIP_CAMPAIGN, 'event_alumni'])
// naija and terere are the country-launch cohorts. Both are distributed as BARE
// campaign links with no inviter, and both are in peanut-api-ts
// POSTLAUNCH_SKIP_BADGE_CODES — so they belong here, not in BARE_VANITY_CAMPAIGNS
// (that set is for badges with no card-waitlist skip, and would show the wrong
// copy while the backend granted a skip anyway).
export const WAITLIST_SKIP_CAMPAIGNS: ReadonlySet<string> = new Set([SKIP_CAMPAIGN, 'event_alumni', 'naija', 'terere'])
export const BARE_VANITY_CAMPAIGNS: ReadonlySet<string> = new Set([
'touched_grass',
'card_alpha',
Expand Down
Loading