test(frontend): add missing enrich export to SwapPage preflight mock (2 red tests on main) #864
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!864
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/337-swappage-preflight-mock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SwapPage.test.tsx has 2 deterministically red tests on main: the #293 expert-mode slippage block and the #329 fallback-label test.
Root cause (bisected):
76723cf(#341 preflight fix, merged ina6c43ca) added an enrichSwapOperationsWithHopMinReturns call to the quote path, but the suite's vi.mock factory for swapRoutePreflight only exports preflightSwapRouteSpread. Under the mock the function is undefined, the call throws inside the try, gets caught as an indexer failure, and the quote path dies — #293's test never gets a quote ("Quote unavailable"), #329's falls through to client BFS and renders the fallback label it asserts absent.Test-bug only — no product regression; the real function on the live path is fine (#341 behavior verified separately).
Fix: export a typed passthrough mock (async (operations: SwapOperation[]) => operations). SwapPage.test.tsx runs 11/11 with it; eslint clean.
Found during the #337 sweep — details in the note there. Companion MR fixes the tsc -b break from the same sweep.
mentioned in issue #337
mentioned in commit
4e125ef102