2.5 KiB
2.5 KiB
Quick Test Guide - Balance Bug Fix
Test the Fix in 60 Seconds
Setup (5 seconds)
cd /home/debian/harb
# Ensure dev environment is running
# If not: npm run dev in web-app/
Test Steps (55 seconds)
-
Open app in browser (http://localhost:5173 or staging URL)
-
Connect wallet - Use MetaMask or test wallet
-
Navigate to Cheats page (/cheats)
-
Check current KRK balance
- Open browser console
- Type:
console.log('Balance before swap') - Navigate to Stake page, note the balance
-
Return to Cheats page
-
Perform swap:
- Enter amount:
0.1ETH - Click "Buy" button
- Confirm transaction in wallet
- Enter amount:
-
Watch for:
- ✅ Toast notification: "Swap submitted..."
- ✅ Transaction confirmation
- ✅ No console errors
-
Immediately navigate to Stake page
-
Verify:
- ✅ KRK balance displays new amount (not 0)
- ✅ Balance loads within 1-2 seconds
- ✅ Slider shows correct max amount
- ✅ "Insufficient Balance" does NOT appear
- ✅ Can input stake amount and submit
Expected Console Output
loadBalance // This should appear right after swap
Success Criteria
✅ Balance updates immediately after swap completes
✅ No delay when navigating to stake page
✅ Stake form is usable without refresh
If Test Fails
Check:
- Did the swap transaction actually confirm? (check wallet)
- Any errors in browser console?
- Is the RPC endpoint responding? (Network tab)
- Is the correct contract address configured?
Debug Commands:
# Check if changes are present
cd /home/debian/harb/web-app/src/views
grep -A 3 "loadBalance()" CheatsView.vue
# Should show the new code
# Check imports
grep "useWallet" CheatsView.vue
# Should show: import { useWallet } from '@/composables/useWallet';
Files to Review
- Bug Analysis:
/home/debian/harb/tmp/usertest-results/BALANCE-BUG-ANALYSIS.md - Fix Summary:
/home/debian/harb/tmp/usertest-results/BALANCE-BUG-FIX-SUMMARY.md - Modified File:
/home/debian/harb/web-app/src/views/CheatsView.vue
Before vs After Comparison
| Scenario | Before Fix | After Fix |
|---|---|---|
| Swap then navigate | Balance: 0 KRK (or waits 10-90s) | Balance: correct amount (1-2s) |
| Can stake? | ❌ "Insufficient Balance" | ✅ Yes, immediately |
| User frustration | 😤 High | 😊 None |
| Required workaround | Page refresh or wait | None needed |
Quick Validation: If you can swap → navigate → stake without any wait or error, the fix works! 🎉