Skip to content

Commit 1c479e3

Browse files
committed
Replace PR references in e2e test comments with self-contained descriptions
1 parent bb615d2 commit 1c479e3

4 files changed

Lines changed: 55 additions & 38 deletions

File tree

packages/join-e2e/tests/04-donation-upsell.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { test, expect } from '@playwright/test';
22
import { mockRestEndpoints, CONTINUE } from './helpers';
33

44
/**
5-
* Phase 4 — Donation upsell (standard join flow with ASK_FOR_ADDITIONAL_DONATION on)
5+
* Phase 4 — Donation upsell
66
*
7-
* PR #59 test plan sections 2, 3, 4.
7+
* Tests the standard join flow when ASK_FOR_ADDITIONAL_DONATION is enabled.
8+
* After the member selects a plan, an optional donation upsell page is shown
9+
* before the payment step. Members can choose an amount, optionally make it
10+
* recurring, or skip the donation entirely with "Not right now".
811
*
912
* Config: ASK_FOR_ADDITIONAL_DONATION=true, DONATION_SUPPORTER_MODE=false.
10-
* The upsell donation page appears after plan selection.
1113
*
1214
* All REST endpoints are mocked. The bundle is built with USE_TEST_DATA=true
1315
* so all personal-detail fields are pre-filled.

packages/join-e2e/tests/05-supporter-mode-monthly.spec.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ import { mockRestEndpoints, captureJoinBodyViaStripeRedirect, injectEnvOverrides
44
/**
55
* Phase 5 — Supporter mode, monthly donations
66
*
7-
* PR #59 test plan sections 5 and 7.
7+
* Tests the Donation Supporter Mode flow where the donation step comes first
8+
* (before personal details and payment). Members choose a giving tier or enter
9+
* a custom amount, with monthly recurring selected by default.
810
*
9-
* Config: DONATION_SUPPORTER_MODE=true, USE_STRIPE=true (injected).
10-
* The donation page is the FIRST step (not the details page).
11-
* Monthly frequency is selected by default.
11+
* Covers: first-step rendering, tier/custom-amount CTA updates, advancing
12+
* through donation → details, and the /join request body for a monthly
13+
* recurring supporter donation (donationAmount=0 because the plan price IS
14+
* the donation; recurDonation=true).
15+
*
16+
* Config: DONATION_SUPPORTER_MODE=true, USE_STRIPE=true (injected via env override).
1217
*/
1318

1419
const SUPPORTER_PAGE = '/e2e-supporter/';
@@ -101,8 +106,8 @@ test.describe('5.5 — /join body for monthly supporter donation', () => {
101106
});
102107
});
103108

104-
test.describe('5.6 — Product naming: Donation prefix for supporter mode', () => {
105-
test('/join body membership starts with the plan value (not "Membership:")', async ({ page }) => {
109+
test.describe('5.6 — Product naming: supporter mode produces a Donation product', () => {
110+
test('/join body signals a recurring supporter donation (recurDonation=true, donationAmount=0)', async ({ page }) => {
106111
await page.locator('button:has-text("£5")').click();
107112
await page.locator('button[type="submit"]').click();
108113
await page.waitForSelector('input#firstName');
@@ -118,10 +123,10 @@ test.describe('5.6 — Product naming: Donation prefix for supporter mode', () =
118123
});
119124

120125
// ---------------------------------------------------------------------------
121-
// Section 7 — Custom amount
126+
// Custom amount (plan with allow_custom_amount enabled)
122127
// ---------------------------------------------------------------------------
123128

124-
test.describe('5.7 — Custom amount updates CTA (PR #59 section 7)', () => {
129+
test.describe('5.7 — Custom amount updates CTA', () => {
125130
test('entering a custom amount updates CTA to reflect the custom value', async ({ page }) => {
126131
await injectEnvOverrides(page, `**${SUPPORTER_CUSTOM_PAGE}`, { USE_STRIPE: true });
127132
await mockRestEndpoints(page);

packages/join-e2e/tests/06-supporter-mode-oneoff.spec.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ import { mockRestEndpoints, captureJoinBodyViaStripeRedirect, injectEnvOverrides
44
/**
55
* Phase 6 — Supporter mode, one-off donations
66
*
7-
* PR #59 test plan sections 8 and 8a.
7+
* Tests the one-off donation path within Supporter Mode. When Stripe card
8+
* payments are available (USE_STRIPE=true, STRIPE_DIRECT_DEBIT_ONLY=false),
9+
* the One-off tab is enabled. Selecting it changes the CTA to "Donate £X now"
10+
* (no "/month" suffix) and sets paymentMethod to creditCard.
811
*
9-
* Config: DONATION_SUPPORTER_MODE=true, USE_STRIPE=true, STRIPE_DIRECT_DEBIT_ONLY=false.
10-
* The One-off tab must be enabled and selecting it changes the CTA to "Donate £X now".
12+
* Because Stripe does not create a subscription for one-off donations, the
13+
* proxy assertion used here is the /join request body:
14+
* - recurDonation: false — the frontend signals a one-off intent
15+
* - donationAmount: N — the PaymentIntent amount (not 0)
16+
* The backend routes this through createPaymentIntent rather than a
17+
* subscription, which is the equivalent server-side check.
1118
*
12-
* Verifying "no subscription created" in Stripe is not possible without live
13-
* credentials. As a proxy, the /join request body is inspected:
14-
* - recurDonation: false → the frontend signals a one-off intent
15-
* - donationAmount: N → the amount for the PaymentIntent (not 0)
16-
* The backend routes this through createPaymentIntent rather than creating a
17-
* subscription, which is the equivalent server-side assertion.
19+
* Config: DONATION_SUPPORTER_MODE=true, USE_STRIPE=true, STRIPE_DIRECT_DEBIT_ONLY=false
20+
* (all injected via env override since these are global plugin settings).
1821
*/
1922

2023
const SUPPORTER_PAGE = '/e2e-supporter/';
@@ -60,7 +63,7 @@ test.describe('6.2 — Selecting One-off updates CTA', () => {
6063
});
6164
});
6265

63-
test.describe('6.3 — /join body for one-off supporter donation (PR #59 section 8)', () => {
66+
test.describe('6.3 — /join body for one-off supporter donation', () => {
6467
test('recurDonation=false and donationAmount>0 in /join body for one-off', async ({ page }) => {
6568
await loadSupporterPage(page);
6669

@@ -95,7 +98,7 @@ test.describe('6.3 — /join body for one-off supporter donation (PR #59 section
9598
});
9699
});
97100

98-
test.describe('6.4 — One-off custom amount (PR #59 section 8a)', () => {
101+
test.describe('6.4 — One-off custom amount', () => {
99102
test('custom amount on one-off updates CTA to "Donate £X now"', async ({ page }) => {
100103
await injectEnvOverrides(page, `**${SUPPORTER_CUSTOM_PAGE}`, {
101104
USE_STRIPE: true,

packages/join-e2e/tests/07-supporter-mode-edge-cases.spec.ts

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,26 @@ import { mockRestEndpoints, captureJoinBodyViaStripeRedirect, injectEnvOverrides
44
/**
55
* Phase 7 — Supporter mode edge cases and product naming
66
*
7-
* PR #59 test plan sections 9, 10, and 13.
7+
* One-off tab disabled when Direct Debit Only is active:
8+
* When STRIPE_DIRECT_DEBIT_ONLY=true, the One-off tab is disabled and an
9+
* explanatory note is shown. Monthly donations remain available.
810
*
9-
* Section 9: One-off tab disabled when STRIPE_DIRECT_DEBIT_ONLY=true.
10-
* Section 10: No plans configured shows a warning.
11-
* Section 13: Product naming — /join request body carries the correct
12-
* membership value prefix for standard vs supporter mode.
11+
* No plans configured:
12+
* When a Supporter Mode block has no membership plans set, the donation page
13+
* shows a "No donation amounts configured" warning instead of tier buttons.
1314
*
14-
* Note: Section 11 (free membership) is already covered by Phase 3
15-
* (03-free-membership.spec.ts). Section 12 (Mailchimp non-fatal errors)
16-
* is a backend concern verified by PHP unit tests; the frontend always
17-
* receives success:true regardless of Mailchimp state.
18-
* Section 6 (supporter mode monthly via Direct Debit) requires a live
19-
* GoCardless integration and is covered by manual testing.
15+
* Product naming in /join request body:
16+
* - Standard join: membership field holds a plan ID (not prefixed "Donation:").
17+
* The backend names the Stripe product "Membership: <plan label>".
18+
* - Supporter mode monthly: recurDonation=true and donationAmount=0 signal
19+
* that the plan price IS the donation; backend names it "Donation: <label>".
20+
* - Supporter mode one-off: recurDonation=false and donationAmount>0 signal
21+
* a one-time PaymentIntent; backend uses the "Supporter Donation" product.
22+
*
23+
* Note: Free membership (payment skipped for zero-price plans) is covered by
24+
* Phase 3 (03-free-membership.spec.ts). Mailchimp non-fatal error handling is
25+
* a backend concern covered by JoinServiceMailchimpTest.php. Supporter mode
26+
* monthly via Direct Debit requires a live GoCardless integration.
2027
*/
2128

2229
const SUPPORTER_PAGE = '/e2e-supporter/';
@@ -27,7 +34,7 @@ const STANDARD_PAGE = '/e2e-standard-join/';
2734
// Section 9 — One-off disabled when Direct Debit only
2835
// ---------------------------------------------------------------------------
2936

30-
test.describe('7.1 — One-off tab disabled when STRIPE_DIRECT_DEBIT_ONLY=true (PR #59 section 9)', () => {
37+
test.describe('7.1 — One-off tab disabled when STRIPE_DIRECT_DEBIT_ONLY=true', () => {
3138
test.beforeEach(async ({ page }) => {
3239
await injectEnvOverrides(page, `**${SUPPORTER_PAGE}`, {
3340
USE_STRIPE: true,
@@ -64,7 +71,7 @@ test.describe('7.1 — One-off tab disabled when STRIPE_DIRECT_DEBIT_ONLY=true (
6471
// Section 10 — No plans configured
6572
// ---------------------------------------------------------------------------
6673

67-
test.describe('7.2 — No plans configured warning (PR #59 section 10)', () => {
74+
test.describe('7.2 — No plans configured warning', () => {
6875
test.beforeEach(async ({ page }) => {
6976
await injectEnvOverrides(page, `**${SUPPORTER_NO_PLANS_PAGE}`, { USE_STRIPE: true });
7077
await mockRestEndpoints(page);
@@ -87,7 +94,7 @@ test.describe('7.2 — No plans configured warning (PR #59 section 10)', () => {
8794
// Section 13 — Product naming
8895
// ---------------------------------------------------------------------------
8996

90-
test.describe('7.3 — Product naming: standard join (PR #59 section 13)', () => {
97+
test.describe('7.3 — Product naming: standard join', () => {
9198
test('/join body membership does not contain "Donation:" prefix for standard join', async ({ page }) => {
9299
await injectEnvOverrides(page, `**${STANDARD_PAGE}`, { USE_STRIPE: true });
93100
await mockRestEndpoints(page);
@@ -110,7 +117,7 @@ test.describe('7.3 — Product naming: standard join (PR #59 section 13)', () =>
110117
});
111118
});
112119

113-
test.describe('7.4 — Product naming: supporter mode monthly (PR #59 section 13)', () => {
120+
test.describe('7.4 — Product naming: supporter mode monthly', () => {
114121
test('/join body signals a recurring donation (recurDonation=true, donationAmount=0)', async ({ page }) => {
115122
await injectEnvOverrides(page, `**${SUPPORTER_PAGE}`, {
116123
USE_STRIPE: true,
@@ -136,7 +143,7 @@ test.describe('7.4 — Product naming: supporter mode monthly (PR #59 section 13
136143
});
137144
});
138145

139-
test.describe('7.5 — Product naming: supporter mode one-off (PR #59 section 13)', () => {
146+
test.describe('7.5 — Product naming: supporter mode one-off', () => {
140147
test('/join body signals a one-off donation (recurDonation=false, donationAmount>0)', async ({ page }) => {
141148
await injectEnvOverrides(page, `**${SUPPORTER_PAGE}`, {
142149
USE_STRIPE: true,

0 commit comments

Comments
 (0)