Problem
src/components/BalanceList.tsx renders three states: a loading skeleton (3 SkeletonRow placeholders), an empty message when no balances exist, and the list of AssetRow components. None of these states have automated tests.
The duplicate key bug (key={b.asset} — tracked separately) also has no regression test, meaning it could silently re-appear after any fix. Two more specific untested behaviors: (1) the skeleton renders exactly 3 placeholder rows — not 2, not 4; (2) each AssetRow displays the correct assetCode and formatted balance string from the mock data.
Solution
Write React Testing Library tests for BalanceList using a mock SorokitProvider. Test:
- Disconnected state: connect prompt is rendered, no balance rows visible
- Loading state: exactly 3 skeleton rows render while
isLoadingAccount is true
- Empty state: empty-balances message renders when
balances is an empty array
- Loaded state: an
AssetRow renders for each balance with the correct asset code and amount
- No React duplicate-key warnings appear in the console during any test
Acceptance Criteria
Note for Contributors: If you're assigned to this issue, write a clear and detailed description for your pull request. Explain what was changed, why it was needed, how it was implemented, and include any relevant testing or screenshots where applicable.
Problem
src/components/BalanceList.tsxrenders three states: a loading skeleton (3SkeletonRowplaceholders), an empty message when no balances exist, and the list ofAssetRowcomponents. None of these states have automated tests.The duplicate key bug (
key={b.asset}— tracked separately) also has no regression test, meaning it could silently re-appear after any fix. Two more specific untested behaviors: (1) the skeleton renders exactly 3 placeholder rows — not 2, not 4; (2) eachAssetRowdisplays the correctassetCodeand formattedbalancestring from the mock data.Solution
Write React Testing Library tests for
BalanceListusing a mockSorokitProvider. Test:isLoadingAccountis truebalancesis an empty arrayAssetRowrenders for each balance with the correct asset code and amountAcceptance Criteria
npm test