Skip to content

fix: batch resolve dashboard events, hooks, and missing tests (#865, #863, #867, #868) - #1026

Merged
k-deejah merged 1 commit into
Sorokit:mainfrom
investorUsman:fix/issue-865-use-outside-click
Oct 22, 2026
Merged

k-deejah merged 1 commit into
Sorokit:mainfrom
investorUsman:fix/issue-865-use-outside-click

Conversation

@investorUsman

@investorUsman investorUsman commented Oct 19, 2026 •

Copy link
Copy Markdown

Resolves #865
Resolves #863
Resolves #867
Resolves #868

Summary

Single comprehensive PR resolving all four assigned issues.

Changes

#865 — useOutsideClick

  • Removed the early if (!enabled) return; so the effect always provides a cleanup.
  • Listener registration is guarded by if (enabled), while cleanup always calls document.removeEventListener for all three event types.
  • Added a regression test asserting the exact listener instances registered are the ones removed when disabled.

#863 — ContractEventFeed

  • readPersistedFromLedger ignores non-numeric/negative sessionStorage values and falls back to the prop/default window.
  • persistFromLedger refuses to write non-finite or negative ledgers.
  • Tests cover persistence under the contract-specific key, clearing the previous contract's key on contractId change, corrupted values, and the unmount/remount resume path.

#867 — NFTScreen tests

  • Added assertions that nft.getNfts is called with the connected address and that the disconnected prompt renders.
  • Uses createMockClient() from src/lib/mock-client.ts.

#868 — StakingDashboard tests

  • Uses the createMockClient() pattern in the mocked context.
  • Added an inline delegation-adjustment test that verifies delegated totals update and refreshAccount is called.
  • handleClaimAll now refreshes the connected account after claiming; the claim-all test asserts that refresh.

Testing

  • Focused run for the four affected files: 4 files, 78 tests passed
  • Full Vitest suite: 100 files, 2039 tests passed
  • ESLint on changed files: clean
  • tsc -b --noEmit: clean

Notes

Only the files relevant to these four issues are included; unrelated untracked files were intentionally left out.

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@investorUsman 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

@investorUsman
investorUsman force-pushed the fix/issue-865-use-outside-click branch from 35033d2 to 9346dd1 Compare October 20, 2026 00:19
@investorUsman investorUsman changed the title fix: useOutsideClick cleanup listener when enabled toggles to false (#865) fix: batch resolve dashboard events, hooks, and missing tests (#865, #863, #867, #868) Oct 20, 2026
@k-deejah
k-deejah merged commit 3472566 into Sorokit:main Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants