Skip to content

fix(tests): align tests and analytics docs with removed plan billing and Boat offer - #88

Open
zereight wants to merge 1 commit into
mainfrom
fix/tests-for-removed-features
Open

zereight wants to merge 1 commit into
mainfrom
fix/tests-for-removed-features

Conversation

@zereight

@zereight zereight commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

What changed

Tests and analytics docs that still expected surfaces this fork removed on purpose now match the fork. No product code changes, except deleting one module nothing imports.

  • Cases that only test a removed feature are deleted (listed per file below, with the commit that removed the feature).
  • Cases that also test something still in the fork are rewritten to the fork's behaviour, so that part keeps its check.
  • src/lib/cloud-add-web.ts (and its two test files) is deleted and added to REMOVED in src/lib/plan-billing-removed.test.ts. That guard asks for new purchase surfaces to be added there.
  • Five event rows go from docs/analytics.md and its mirror apps/docs/content/docs/security/analytics.mdx.

Why

These 9 files fail in the main vitest shards: seven since the first CI run (915596c, 2026-11-14), App.cloud-add-web and AnnouncementsPage since the #42 sync was merged (34e4f26, 2026-11-21). The fork removed these features on purpose. The tests and docs rows were never updated:

Per file:

file removed by deleted cases rewritten
RoutineScheduleNote.test.ts #2 fixed schedulePlace to next: null on this computer "says it in plain words with Open the Cloud as the link, and asks before leaving the routine being edited" "This computer: …" now checks next: null for every plan × ready × offersAllowed
BotApiCard.dom.test.ts #2 deleted CloudUsageMeter and the card's Upgrade "on Starter with no way to change the plan from this page, shows the line alone" (now the same as the first case) first case: Starter is the line alone, bot-api-upgrade absent; mock of the deleted ../CloudUsageMeter dropped
BotLimitPopup.test.ts #2 stubbed usageBridge to undefined, so the popup always links to the Plan page "goes through the usual preview and confirmation…", "names what went wrong and stays open when the upgrade is refused", "says the upgrade is going through…", "on a person's other Cloud, which only reads its plan…", "leaves Escape to the confirmation while it is open" first case: title, aria-modal, focus on "Open the Plan page"; tasks case: buttons Open the Plan page, Not now, Close; the unused window.ogb.cloudPlan fixture is gone
CloudRoomCard.dom.test.ts #2 stubbed CloudRoomCard to null (room-card-preview is in REMOVED) "says what ran short…", "forgets an upgrade once the session…", "waits while any bot is working…", "shows the top plan a tip…" "shows no room card: its upgrade offer went with plan billing"
AnnouncementsPage.test.ts #3 removed boat-credit-2026-11 none the Boat row and its buttons are no longer expected
App.cloud-add-web.test.ts, src/lib/cloud-add-web{,.test}.ts #2 (purchase surface), back via #42 whole files src/lib/cloud-add-web.ts added to REMOVED
scripts/testing/analytics-docs.test.ts (docs only) #2 removed the Add a Cloud dialog (CloudAddDialog, AddCloudFlow are in REMOVED) rows cloud_dialog_shown, cloud_dialog_view, cloud_signin, cloud_add_another, and cloud_checkout_opened (its only sender was cloud-add-web.ts) none
PlacesRail.test.ts #2: PlaceAddSheet offers no Cloud or organization; with only a server it opens the server form directly "+ for the account a Team plan's organizations are billed to…", "New organization says plainly why it can't be added…", "Buy a Cloud, for someone whose Admin sells one Cloud per account…" first + case: no choices, straight to the server form, rest unchanged; 5 server-form cases lose only their data-place-add-choice="server" click; the local-workspace case expects ["local", "server"]
CloudAccountSettings.test.ts #2: cloudPlanView answers only signed-out/removed; paid, free, purchase, trial and unverified views are billing (src/lib/cloud-plan.ts:13) "a free account starts in the Add a Cloud dialog…", "a failed re-check keeps the plan, Cloud and Connect…", "OMB Cloud out of reach: the plan last verified stays named…", "a payment problem or a stopped Cloud…", "a payment being linked…", "where this app can keep another account beside this one…", "a free account may add a Cloud…", "a free trial says…", "an ended trial is one message…", "signed out or with no plan, the Add a Cloud button names the trial…", "on My Cloud, Settings shows the trial and its credit…" "names the tier…" checks cloudPlanLabel directly, still with the constructor/toString rows; "setting up…" drops only the paid view's placeholder card; "a Team plan…" drops the two steps that need the paid view's placeholder

The Cloud machine card (ready, stopped, payment problem, setup, connect) is still covered by the it.each over machine states and the connect cases in CloudAccountSettings.test.ts. None of those were changed.

How it was verified

macOS, Node v24.22.1 (same major as CI). The same command was run on main 8c67e9d and on this branch:

pnpm exec vitest run src/components/CloudAccountSettings.test.ts src/components/bot-settings/BotApiCard.dom.test.ts src/components/BotLimitPopup.test.ts src/components/CloudRoomCard.dom.test.ts src/components/PlacesRail.test.ts src/components/RoutineScheduleNote.test.ts scripts/testing/analytics-docs.test.ts src/App.cloud-add-web.test.ts src/components/announcements/AnnouncementsPage.test.ts [src/lib/plan-billing-removed.test.ts after]
file Before (main) After (this branch)
PlacesRail.test.ts 10 failed / 44 passes (41)
CloudAccountSettings.test.ts 17 failed / 55 4 failed / 44 (see below)
BotLimitPopup.test.ts 7 failed / 18 passes (13)
CloudRoomCard.dom.test.ts 4 failed / 5 passes (1)
RoutineScheduleNote.test.ts 2 failed / 3 passes (2)
App.cloud-add-web.test.ts 2 failed / 3 deleted
BotApiCard.dom.test.ts 1 failed / 12 passes (11)
AnnouncementsPage.test.ts 1 failed / 6 passes (6)
analytics-docs.test.ts 1 failed / 2 passes (2)
plan-billing-removed.test.ts not in the Before run passes (26, one new REMOVED row)
total Test Files 9 failed (9), Tests 45 failed | 103 passed (148) Test Files 1 failed | 8 passed (9), Tests 4 failed | 142 passed (146)

pnpm typecheck exits 0. oxlint --deny-warnings src scripts/testing exits 0. The pre-push hook reported pre-push: 10 changed file(s) checked in 0.1 s.

Failures left after this PR

CloudAccountSettings.test.ts still fails 4 cases. This PR does not change them on purpose:

  • "names the tier; no tier is today's Pro, and a tier newer than the app reads Cloud": passes together with fix(cloud-plan): a tier named like an Object prototype key reads Cloud again #87. Remove plan billing: purchase, checkout, cancel and usage-upgrade surfaces #2 rewrote cloudPlanLabel as PLAN_LABEL[tier] ?? "Cloud" and lost upstream's Object.hasOwn check, so cloudPlanLabel("constructor") returns Object (expected [Function Object] to be 'Cloud'). fix(cloud-plan): a tier named like an Object prototype key reads Cloud again #87 (fix/cloud-plan-label-own-keys) fixes the code. This PR keeps the constructor/toString rows.
  • Three sign-in cases. The cloud-plan stub answers signed-out for signed-in and reauth-required accounts too (src/lib/cloud-plan.ts:14-17, enforced by plan-billing-removed.test.ts:49-56). So Settings → Account shows "Sign in to MausBot · Sign in" next to "person@example.test · Signed in · Refresh". That is a code change for a separate PR:
    • "a late initial snapshot cannot replace a newer revoked state": expected … to contain 'no longer signed in to MausBot Cloud'
    • "a sign-in that ended asks to sign in again, keeps the plan, and offers nothing to buy": expected … to contain 'Max plan'
    • "while a saved sign-in is read, nothing is offered and the Cloud link waits": expected … to contain 'Loading Cloud account'

Not covered

  • Full pnpm test was not run locally. The other shard failures on main have separate causes.
  • Product code that can no longer run was left in place, because removing it is out of scope:
    • the add-cloud/open-cloud branches and openCloud in RoutineScheduleNote.tsx
    • UpgradeButton, settled and the "going through" path in BotLimitPopup.tsx
    • the boat icon entry in AnnouncementsPage.tsx:24
    • openCloudAdd dispatches with no Add a Cloud dialog to open
    • the header comment of PlaceAddSheet.tsx, which still describes organization and Cloud choices
  • The Electron cloudAdd bridge (start, organization, sheet, …) is unchanged.

Checklist

  • pnpm typecheck and pnpm test pass locally: typecheck passes; only the 10 files above were run, and 4 known cases still fail.
  • Server behavior changes come with tests: no server change
  • No dist-server/ edits
  • macOS-only code is platform-gated: none added
  • No secrets in logs, responses, events, or argv

…and Boat offer

Plan billing (#2), the Boat offer (#3) and the #42 sync left tests and docs rows that still expect the removed checkout, upgrade, trial, organization and Boat surfaces. Drop the cases that only test removed features, rewrite the rest to the fork's behaviour, delete the unused cloud-add-web module that #42 brought back, and add it to the plan-billing guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant