Security: wrap pause and rate limit tests assert button visibility only, not copy or disabled state [SEC-A02] #389
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#389
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Checklist Item
SEC-A02: Write user-facing copy for trading blacklist, pair pause, wrap pause, rate limit, indexer outage, and excessive slippage states. Verify: frontend tests assert clear messages and disabled CTAs where applicable.
Summary
Copy exists for wrap pause ("Wrapping is Temporarily Paused") and rate limit ("Rate Limit Exceeded") but the only test covering these states checks that a button is visible on screen without asserting the specific copy text or confirming the button is in a disabled state.
What Was Checked
frontend-dapp/src/pages/SwapPage.tsxlines 893-895, 903 -- confirmed copy for both statesfrontend-dapp/e2e/wrap-swap.spec.tslines 205-218 -- the only test covering these statessrc/**/__tests__/andfrontend-dapp/e2e/searched for wrap pause and rate limit assertionsExpected (per checklist)
Frontend tests must assert the specific message copy is displayed and that the submit CTA is disabled for both wrap pause and rate limit states.
Actual
wrap-swap.spec.tstest E12 usesfilter({ hasText: /Rate Limit|Insufficient|Swap/i })which matches multiple possible button states with an OR pattern. It asserts the button is visible but does not confirm which text is showing, does not confirm the button is disabled, and does not isolate the wrap pause state separately from rate limit. There is no unit test for either state.Evidence
frontend-dapp/src/pages/SwapPage.tsxline 893: "Wrapping is Temporarily Paused" button copyfrontend-dapp/src/pages/SwapPage.tsxline 903: "Rate Limit Exceeded" button copyfrontend-dapp/e2e/wrap-swap.spec.tslines 205-218: regex matches three states at once, no disabled assertion, no copy-specific assertionSuggested Fix
Split E12 into two focused tests or add unit tests (Vitest + Testing Library) that:
Verification Checklist
Steps to confirm the fix is complete and the checklist item can be marked done.
Labels
~security ,
pre-launchCc: @PlasticDigits
mentioned in issue #381
mentioned in commit
8e0561c433mentioned in merge request !920
mentioned in commit
7d8b4d1b41mentioned in commit
7cd9c41b3bmentioned in merge request !921
mentioned in commit
4b0e10401fVerification complete — PASS
Verified GitLab #389 / launch checklist SEC-A02 (wrap pause + wrap rate limit CTA copy and disabled state) on
main@4b0e1040.Checklist
SwapPage.test.tsx—shows disabled Wrapping is Temporarily Paused CTA when wrap mapper is paused; Playwrightwrap-swap.spec.ts— isolated describewrap mapper paused shows disabled Wrapping is Temporarily Paused CTAtoBeDisabled()/await expect(btn).toBeDisabled()shows disabled Rate Limit Exceeded CTA when wrap mapper rate limit is exceeded(checkRateLimitExceededmock); Playwright E12 —getByRole('button', { name: 'Rate Limit Exceeded' })with LCD route mock (routeWrapMapperRateLimitExceeded)Swap wrap safety CTA — isolated LCD mocksdescribe; oldRate Limit|Insufficient|SwapOR pattern removed fromwrap-swap.spec.tsCommands run
Evidence in tree
SwapPage.tsx— pause →Wrapping is Temporarily Paused, rate limit →Rate Limit ExceededSwapPage.test.tsxdescribewrap pause and wrap rate limit CTA (SEC-A02 / GitLab #389)e2e/helpers/wrap-mapper-lcd-mock.ts; tests ine2e/wrap-swap.spec.tsdocs/testing.md§ Swap wrap safety CTA,skills/AGENTS_FRONTEND_SWAP_SAFETY_CTA.mdNote: Rate limit coverage is the on-chain wrap mapper quota (
checkRateLimitExceeded/ LCDrate_limitquery mock), not indexer HTTP 429 — consistent withskills/AGENTS_FRONTEND_SWAP_SAFETY_CTA.md.No repo changes from this verification pass.
mentioned in issue #422
mentioned in issue #502
mentioned in issue #503
mentioned in issue #507
mentioned in issue #630