Skip to content

test(frontend): pin the literal Archera signup URL in archera tests - #1320

Merged
IAmJSD merged 1 commit into
LeanerCloud:mainfrom
IAmJSD:ui/issue-49
Oct 24, 2026
Merged

IAmJSD merged 1 commit into
LeanerCloud:mainfrom
IAmJSD:ui/issue-49

Conversation

@IAmJSD

@IAmJSD IAmJSD commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

The two Archera signup-link tests compared the link's href only to the imported ARCHERA_SIGNUP_URL constant, so they would keep passing if the constant drifted to a wrong destination (typo, stray UTM, wrong domain). This PR also pins the literal canonical URL in each test, matching the Go-side fix in LeanerCloud/cloud-commitments-cli#1280.

Closes #49

What changed

  • frontend/src/__tests__/archera.test.ts: in both signup-link tests (education page a.archera-signup-btn and offer modal a.archera-offer-signup), added expect(link!.href).toBe('https://www.archera.ai/cudly') next to the existing constant-based assertion, which is kept as the issue asks. Test-only change, 8 added lines.

Why this approach

It follows the acceptance criteria: one literal pin per surface, with the constant check kept so the tests still prove the code uses the exported const. The literal is inlined in each assertion instead of a shared test constant, so the canonical destination is visible right where it is asserted.

Screenshots

No visible change: this is a test-only change.

Verification

Run on this branch's head 61ebaca1 on top of main a14dc8f2:

  • Lint: 0 errors (142 pre-existing warnings). Typecheck and build pass.
  • Jest: 109 suites, 3486 passed, 1 skipped. archera.test.ts: 29/29, also with --randomize, including both partnership disclosure tests (non-gating "works fully without" and "sponsors").
  • Mutation check: with ARCHERA_SIGNUP_URL temporarily changed to ...cudly?utm_source=oops, both pinned tests fail; main's version of the test file still passes 29/29 with the same mutation.
  • Playwright: 157 passed.
  • git-secrets scan clean (planted key flagged); allowlist test 137 pass.

Note for the UI owner

This changes UI code that @cristim owns. IAmJSD reviewed the before/after screenshots and asked for it to be merged; any design point you disagree with can be a follow-up.

🤖 Generated with Claude Code

Both signup-link tests (education page and offer modal) only compared
the href against the imported ARCHERA_SIGNUP_URL constant, so they kept
passing if the constant itself drifted to a wrong destination (typo,
stray UTM, wrong domain). Each now also asserts the literal canonical
URL, https://www.archera.ai/cudly, mirroring the Go-side fix in
LeanerCloud/cloud-commitments-cli#1280. The constant-based assertion
stays, so the tests still prove the code uses the exported const.

Verified by temporarily changing the constant: both tests fail with the
pin and passed without it.

Refs LeanerCloud#49

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@IAmJSD IAmJSD added impact/internal Team-internal only type/chore Maintenance / non-user-visible triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline effort/xs Trivial / one-liner labels Oct 24, 2026
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

Or wait 58 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 61be5b6 and 61ebaca.

Files selected for processing: 1
  • frontend/src/__tests__/archera.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@IAmJSD

IAmJSD commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): APPROVE 61ebaca19f87e65b113991550150f0ed8b12a2a7

Blocking:

  • none
    Non-blocking:
  • frontend/src/tests/archera.test.ts:169,254: the kept toBe(ARCHERA_SIGNUP_URL) assertion cannot actually prove "built from the exported const": once the literal pin passes, a hard-coded copy of the URL would pass too. The issue asked to keep it, so this is fine as is.
    Attacked: Diffed against the issue's acceptance criteria. There is one literal pin per surface (education page and offer modal), and the constant assertion is kept. Checked that archera.ts:29 equals the literal, and that jsdom's href normalization leaves https://www.archera.ai/cudly unchanged (no trailing slash is added). The change is test-only, so Closes Pin literal Archera signup URL in frontend archera tests (parity with #1280 Go fix) #49 is accurate.

@IAmJSD

IAmJSD commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

Local verification at 61ebaca1 merged onto current main (ee7b2f6f; merge-tree 4b298124; Linux, Node, headless Chromium):

  • This branch's own checks passed at this head: lint, typecheck, build, the full jest suite, the full Playwright e2e suite, and the git-secrets checks (see Verification in the PR body).
  • The combined tree of every UI PR in this merge wave (tree 89dd34d8, main plus 46 PRs) passes npm ci, lint, typecheck, build, jest (1 skipped, 3914 passed, 3915 total), and the full Playwright suite (208 passed).
  • CI is green on 61ebaca1 (CI Success, Run pre-commit hooks).
  • The independent review above approves this exact head.
  • Nothing was applied to any cloud.

@IAmJSD
IAmJSD marked this pull request as ready for review October 24, 2026 15:46
@IAmJSD
IAmJSD merged commit 85579c5 into LeanerCloud:main Oct 24, 2026
29 checks passed
@IAmJSD

IAmJSD commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

Marked ready and merged by IAmJSD's agent, at IAmJSD's request (IAmJSD reviewed the before/after screenshots; cristim is traveling), after the independent review and local verification above, all at 61ebaca1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/internal Team-internal only priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/eventually No deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin literal Archera signup URL in frontend archera tests (parity with #1280 Go fix)

1 participant