Repository navigation
test(e2e): the last four specs use the shared apiCall instead of their own fetch helper - #584
Merged
Merged
Conversation
…r own fetch helper admin-policy, auth-recovery, git-migrations and workspaces each defined the same `api()` fetch wrapper. Each is now a one-line call into helpers/accounts.ts's apiCall, so the 57 call sites stay as they are and there is one place that builds a request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Board card
e2e-api-helper: #550 addedapiCalltohelpers/accounts.ts, but four specs still defined their own copy of the same fetch wrapper:admin-policyauth-recoverygit-migrationsworkspacesEach local
apiis now a one-line call intoapiCall, keeping its signature, so all 57 call sites are unchanged. The now-unusedAPI_URLconstants are gone from three specs.Differences checked:
bodyfor truthiness rather than!== undefined; no call passes a falsy body.auth-recoverycopy sent nocookieheader, whileapiCallsends an empty one. The signed-out cases (/auth/password/code404, login 401 and 200) pass either way.Run against a live API and web app:
workspacesauth-recoveryadmin-policygit-migrationsThe first MySQL run failed: the container was stopped, then the seed was stale (RUNNING_E2E.md: reseed before every run).
e2e
tscand eslint are clean.🤖 Generated with Claude Code
Note
Low Risk
Test-only refactor with behavior verified against a live API; no production code paths affected.
Overview
Four E2E specs (
admin-policy,auth-recovery,git-migrations,workspaces) no longer define their ownfetch-based/apiwrappers. Each keeps a one-line localapithat forwards toapiCallfromhelpers/accounts.ts, so existing call sites and signatures stay the same.The duplicated
E2E_API_URLconstants are removed from three of those files (centralized on the helper).workspacesstill declaresAPI_URLfor a couple of direct loginfetchcalls that needset-cookieparsing.This is deduplication only—no test logic or assertions change.
Reviewed by Cursor Bugbot for commit 010c3dd. Bugbot is set up for automated code reviews on this repo. Configure here.