Security: no frontend tests assert blacklist message copy or disabled CTAs [SEC-A02] #388
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#388
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
User-facing copy for the trading blacklist state exists in the codebase but there are zero frontend tests -- unit or e2e -- that assert the message text is displayed or that action buttons are disabled when a wallet, token, or pair is blacklisted.
What Was Checked
frontend-dapp/src/services/terraclassic/blacklist.ts-- confirmed copy exists for wallet, pair, token, and generic blacklist statesfrontend-dapp/src/hooks/useTradingBlacklist.ts-- confirmed hook manages blacklist statefrontend-dapp/src/components/trade/TradeOrderTicket.tsxlines 688-695 -- confirmed alert renders blacklist messagefrontend-dapp/src/pages/SwapPage.tsxline 897 -- confirmed "Trading restricted" disabled button textsrc/**/__tests__/,src/pages/*.test.tsx,frontend-dapp/e2e/Expected (per checklist)
Frontend tests must assert that when a wallet, token, or pair is blacklisted: the correct message copy is displayed, and relevant action CTAs (swap, provide, withdraw, limit place/cancel/claim) are disabled.
Actual
No test file asserts any blacklist message string or checks that a CTA is disabled under blacklist conditions. The blacklist service and hook exist and are wired into the UI but the behavior is untested at the frontend layer.
Evidence
frontend-dapp/src/services/terraclassic/blacklist.tslines 39-53: copy defined for all four blacklist variantsfrontend-dapp/src/components/trade/TradeOrderTicket.tsxlines 688-695: alert renders the copyfrontend-dapp/src/pages/SwapPage.tsxline 897: "Trading restricted" button textblacklist,Trading restricted,trading blacklist, oruseTradingBlacklistassertionsSuggested Fix
Add unit tests (Vitest + Testing Library) that mock
useTradingBlacklistto return each blacklist variant (wallet, token, pair, generic) and assert: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
59d87e5f87mentioned in merge request !917
mentioned in commit
6febcc56d4Verification — SEC-A02 / GitLab #388
Verified on
main@13900236(merge6febcc56—issue-388-blacklist-frontend-tests).Checklist
SwapPage.test.tsxtrading blacklist UX—it.eachwallet variant assertsdescribeTradingBlacklistBlockinrole="alert"andTrading restrictedbutton disabledSwapPage.test.tsx+TradePage.test.tsxtoken variants; limit Place buttons (trade-limit-submit) disabled on Tradeit.eachpair variants on Swap + TradeSwapPage.test.tsx+TradePage.test.tsx(rendersTradeOrderTicket; asserts alert copy + disabled limit Place CTAs)blacklist.test.ts— wallet, pair, token, and generic fallback stringsbash scripts/with-node.sh --cwd frontend-dapp -- npm run test:run -- src/services/terraclassic/__tests__/blacklist.test.ts src/pages/SwapPage.test.tsx src/pages/TradePage.test.tsx→ 52/52 passed; targeted-t blacklist→ 9/9 passedSupporting artifacts
frontend-dapp/src/test/tradingBlacklistMocks.tsdocs/security-model.md(SEC-A02 / #388 regression note)Out of scope (not required by issue verification checklist)
Closing as complete.
mentioned in issue #411
mentioned in issue #414
mentioned in issue #417
mentioned in issue #419
mentioned in issue #422
mentioned in merge request !945
mentioned in issue #561