Shop USD Wallet — Test Cases
Feature version: v1.0
Reference doc: Finance System — USD Wallet Operations
Result notation: ✅ Pass | ❌ Fail | ⏭ Skip | 🐛 Fail + bug report
Changelog
| Date | Version | Change | Author |
|---|---|---|---|
| 2026-05-10 | v1.0 | Initial creation | — |
TC-SHOP-001 — Buy credits with USD wallet 🆕 NEW
Precondition: Shop has a USD wallet with sufficient balance.
costRateis configured.
| # | Description | Steps | Expected Result | Actual Result |
|---|---|---|---|---|
| 1 | Shop buys 100 credits with costRate=0.80 | Shop USD wallet = $100; buy 100 credits | USD wallet: −$80; Credit wallet: +100 | |
| 2 | Remaining USD balance is correct after purchase | After buying 100 credits ($80) from $100 | USD wallet balance = $20 | |
| 3 | Credits computed correctly from costRate | costRate=0.80; grossUsd=$80 | credits = 80 / 0.80 = 100 | |
| 4 | Different costRate produces different credit count | costRate=0.90; grossUsd=$90 | credits = 90 / 0.90 = 100 | |
| 5 | Insufficient USD is rejected | USD wallet = $50; attempt to buy 100 credits (costs $80) | Insufficient balance error |
TC-SHOP-002 — Shop withdraws USD 🆕 NEW
Precondition: Shop USD wallet has sufficient balance.
| # | Description | Steps | Expected Result | Actual Result |
|---|---|---|---|---|
| 1 | Shop creates a USD withdrawal request | Shop submits withdrawal from USD wallet | PaymentTransaction { type: 'withdrawal' } created with status = 'pending' | |
| 2 | Approval flow mirrors player withdrawal | Admin approves → payout adapter called | Flow: pending → approved → processing → completed |