Repository navigation
Settings page regression tests (3/6): Membership Plans tab - #135
Merged
Merged
Conversation
Covers the global membership plans and the lapsed, cancelled and lapsing tags: each setting is saved, read back through Settings::get, has its effect on the join form, on joins and in Stripe and Mailchimp (fake API), and is still read when loaded as Carbon Fields stored it. The fake Stripe now lists objects and can have objects put in place by a test, so the plugin's webhook handlers can be driven end to end. Duplicate Stripe prices for prices with pence (JOIN-166) are a skipped test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
This was referenced Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
commented
Oct 24, 2026
conatus
left a comment
Member
Author
There was a problem hiding this comment.
Supplementary review: one issue with how expectSaveRefused will behave once the page is rebuilt. This adds to the inline findings already posted.
Generated by Claude Code
# Conflicts: # packages/join-e2e/tests/settings/support.ts
- Fake Stripe lists filter as Stripe does for what the plugin sends: status=all, ranges such as created[gte], and no canceled subscriptions unless asked for. - expectSaveRefused tries the save when Save isn't disabled, so a page that leaves the check to the browser (native `required`) works too. saveSkippingPageChecksExpectingErrors tests the plugin's own checks; a skipped test shows it doesn't check a plan's Name (JOIN-169). - New test: a member with another active subscription isn't tagged when one ends. - The legacy fixture stores the plan without a Price Point ID under its name alone, as pre-1.4.4 sites have it, so the plugin's lookup for those is tested. - The "never saved" plan test pairs its 500 with a join that succeeds. - The removed-plan test notes it pins today's behaviour (JOIN-170). - addPlan uses the Membership Plans field's own Add button; stored plans are read in one WP-CLI call; the member's Mailchimp hash is worked out from a shared MEMBER_EMAIL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
…s tests Brings in #133 as merged, including its follow-up review changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9 # Conflicts: # packages/join-e2e/tests/settings/support.ts
Master's income guidance (#125) adds each plan's income bands to what the join form is given, and the E2E site has it switched on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
Resolves a conflict in tests/settings/support.ts: master moved the join form page constants to helpers.ts, so the new GLOBAL_PLANS_PAGE joins them there, and admin-plan-redirect.spec.ts uses it instead of its own copy. The plan step helper uses the shared continueToPlans(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- expectSaveRefused waits for the save request rather than the next page, so a save that is made but slow is waited for and checked, instead of being taken for one the browser blocked. - The fake Stripe stores seeded objects as Stripe would, like the ones the plugin creates: an id if none is given, a created time, integer amounts and lowercase currencies. Seeded objects now show in created[gte] listings. - postJoin's doc comment is back on postJoin. - The Mailchimp audience in request paths comes from INTEGRATION_CREDENTIALS instead of being repeated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #146 the plugin sends Stripe the plan's currency in lowercase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saving again now reuses the Stripe price of a plan priced in pence, so the test is no longer skipped, and the docs no longer list it as a known problem. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third of six settings page regression test PRs. #133 and #134 are merged, so this now targets
master.Covers every setting on the Membership Plans tab. Each test changes the setting on the settings page, reads it back through
Settings::get, and checks it does what the rest of the plugin expects. A legacy test loads the settings as Carbon Fields stored them and checks they still work.What's covered (
tests/settings/membership-plans.spec.ts)Global plans
ck_join_flow_membership_plan_<id>) and offered on a join form with no plans of its own, with the right price label, description and "Continue and pay" text./joinalso enforces that minimum.Member tags (fake Stripe and Mailchimp)
Legacy: plans and tags in Carbon Fields' storage format are still read, offered on the form and can be joined on.
Supporting changes
JoinSettingsPage:plans(),addPlan(),editPlan(),removePlan(),expectSaveRefused().postJoin()andpostStripeWebhook()helpers, plusGLOBAL_PLANS_PAGE(inhelpers.tswith the other join form pages).seedFakeStripe), e.g. the customer a webhook names.Problems found
Testing
Locally, all of
tests/settings: 89 passed, 5 skipped (the known-problem tests).Generated by Claude Code