Skip to content

test(SorokitProvider): cover switchNetwork state reset; close stale resolved issues - #645

Merged
k-deejah merged 1 commit into
Sorokit:mainfrom
uche001-dev:chore/close-stale-fixed-issues
Aug 31, 2026
Merged

test(SorokitProvider): cover switchNetwork state reset; close stale resolved issues#645
k-deejah merged 1 commit into
Sorokit:mainfrom
uche001-dev:chore/close-stale-fixed-issues

Conversation

@uche001-dev

Copy link
Copy Markdown
Contributor

Summary

Re-verified #523, #522, and #519 on current main — all three are genuinely fixed already, by earlier work (#611, merged; #640, open), which disclosed the fixes via comments instead of closing keywords, so all three issues are stuck open despite being resolved:

What this PR actually adds

While re-verifying #523, I noticed SorokitProvider.test.tsx covers switchNetwork updating network state and re-pointing the client singleton, but nothing asserts that switching networks clears the previous network's address, account, and balances — even though the provider's switchNetwork explicitly resets all three on a successful switch. Without that test, a regression here (e.g. someone removing the reset while refactoring) would silently show a user's mainnet balances while the UI reports they're on testnet, with no test catching it.

Added one test, switchNetwork clears stale address, account, and balances from the previous network (#523), following the existing disconnectWallet clears... test's pattern: connect, populate account/balances, switch network, assert all three reset to empty.

Not touching the three fixes themselves — they don't need it.

Verification

  • npx vitest run src/context/SorokitProvider.test.tsx — 34/34 passing (was 33/33; the new test is additive).
  • npx eslint src/context/SorokitProvider.test.tsx — clean.
  • npx tsc --noEmit — clean across the whole project.

Why this PR

These three issues are done in every sense except GitHub's bookkeeping. This PR carries the closing keywords the earlier PRs deliberately omitted (per their own disclosure comments), while adding one small, real piece of test coverage surfaced by reviewing the fix — not a no-op housekeeping PR.

closes #523
closes #522
closes #519

Adds a regression test asserting that switchNetwork clears address,
account, and balances left over from the previous network — the
provider already does this (see the reset in switchNetwork), but
nothing in the suite exercised it, so a regression here (e.g. showing
mainnet balances while the UI reports testnet) would go unnoticed.

Related to Sorokit#523, Sorokit#522, and Sorokit#519, which were already fixed on main by
earlier work (Sorokit#611, Sorokit#640) but left open because those PRs used
disclosure comments instead of closing keywords.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@uche001-dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@k-deejah
k-deejah merged commit 6a59a6b into Sorokit:main Aug 31, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants