Skip to content

[Fix] Stub Turnstile in the signup smoke test - #1151

Merged
koutst merged 1 commit into
mainfrom
claude/ci-test-failures-58b0a1
Oct 7, 2026
Merged

koutst merged 1 commit into
mainfrom
claude/ci-test-failures-58b0a1

Conversation

@koutst

@koutst koutst commented Oct 7, 2026

Copy link
Copy Markdown
Member

Summary

Gets the Smoke Tests workflow passing again. It has failed on every pull request since Sept 9 because of one test: "a user can register a new account with an email address".

  • Cause: since 050eaa8 the signup form keeps "Create account" disabled until Cloudflare Turnstile returns a token. Turnstile never issues one to the automated browser, so the click in smoke/auth.spec.ts timed out after 60s, on the first attempt and on the retry.
  • Fix: a stubTurnstile helper in smoke/helpers/auth.ts answers the Turnstile script with a stand-in that reports a made-up token, and the registration test calls it. That test already mocks /api/auth/register/, so nothing verifies the token.
  • No app code changes. Where NEXT_PUBLIC_TURNSTILE_SITEKEY is unset the form requests no script and the stub is never served.

Notes

  • The workflow runs each pull request's own copy of the specs against shared staging, so open pull requests stay red until they pick this up from main.
  • The test does not assert that the token reaches the register request. That would fail on a local run with no sitekey, where the form renders no widget.

Testing

  • The registration test, run against https://staging.researchhub.com/ in local headless Chrome: passes in 3.6s.
  • A throwaway probe against staging, not committed: without the stub the button is still disabled after 12s, which is the CI failure; with it the register request carries the stub's token and the page logs no errors.
  • The other 17 smoke tests were not run locally, since they need the smoke account's credentials. This pull request's own Smoke Tests run covers them.
  • Prettier, ESLint and the full type-check pass (pre-commit hook).

🤖 Generated with Claude Code

The signup form keeps its submit button disabled until Cloudflare
Turnstile returns a token, and Turnstile never issues one to the
automated browser, so the registration smoke test has timed out on
every pull request since the widget was added.

Answer the Turnstile script with a stand-in that reports a made-up
token. The register endpoint is already mocked in this test, so
nothing verifies it.
@koutst
koutst requested a review from a team as a code owner October 7, 2026 15:42
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
web Ready Ready Preview Oct 7, 2026 3:43pm UTC

Request Review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@koutst koutst changed the title Stub Turnstile in the signup smoke test [Fix] Stub Turnstile in the signup smoke test Oct 7, 2026
@koutst
koutst merged commit c89c7ad into main Oct 7, 2026
5 checks passed
@koutst
koutst deleted the claude/ci-test-failures-58b0a1 branch October 7, 2026 16:00

This branch was successfully deployed

1 active deployment
Preview — d2e5a747 Deployed Oct 7, 2026 by vercel[bot]
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