Security: frontend tests for trading blacklist copy and disabled CTAs (#388) #917
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!917
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-388-blacklist-frontend-tests"
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?
Summary
Adds Vitest coverage for SEC-A02 / GitLab #388: when the trading blacklist blocks a wallet, token, or pair, the dApp must show the correct
describeTradingBlacklistBlockuser-facing copy and disable primary action CTAs.describeTradingBlacklistBlockcopy variantstradingBlacklistMockshelper foruseTradingBlacklisthook mocksdocs/security-model.mdAcceptance checklist
cd frontend-dapp && npx vitest run src/pages/SwapPage.test.tsx -t "wallet blacklist"cd frontend-dapp && npx vitest run src/pages/SwapPage.test.tsx src/pages/TradePage.test.tsx -t "token blacklist"cd frontend-dapp && npx vitest run src/pages/SwapPage.test.tsx src/pages/TradePage.test.tsx -t "pair blacklist"cd frontend-dapp && npx vitest run src/pages/SwapPage.test.tsx src/pages/TradePage.test.tsx -t "trading blacklist"cd frontend-dapp && npx vitest run src/services/terraclassic/__tests__/blacklist.test.tstest-frontendjobVerification checklist (third parties)
Check out this branch and run:
Expect 10 passed (4 copy + 3 swap + 3 trade/limit).
Confirm
docs/security-model.mdtrading blacklist section links to the new tests and mock helper.Optional: on LocalTerra with a blacklisted wallet, manually confirm Swap shows the same copy and Trading restricted — not required for this MR (unit tests mock the hook).
Security review — MR !917
Commit reviewed:
59d87e5f87e3f6d9b9554face7c4d45c28d27650Scope: Added/modified files in this MR only —
docs/security-model.md, Vitest coverage (SwapPage.test.tsx,TradePage.test.tsx,blacklist.test.ts), and shared test helpersrc/test/tradingBlacklistMocks.ts.Method: Diff review; traced mock data through test assertions; confirmed
src/testand*.test.*are excluded from the production app TypeScript build (tsconfig.app.json); verified no new runtime dependencies or production code changes.Outcome:
FINDINGS: 0medium+Summary: This MR adds regression tests and documentation for SEC-A02 / #388 (trading blacklist alert copy and disabled swap/limit CTAs). Changes are test-only plus docs. Mock helpers live under
src/test/and are not shipped in the app bundle. Tests mockuseTradingBlacklistwith static fixture responses; they do not alter on-chain enforcement, auth paths, or user-input handling in production.No injection, authz bypass, secret leakage, XSS, or supply-chain issues were introduced by this diff.
describeTradingBlacklistBlock(tested, not modified) returns fixed strings from boolean flags; token/pair addresses in API responses are not interpolated into displayed copy.Inline threads: None (no medium+ findings).
mentioned in commit
6febcc56d4