Repository navigation
test(governance): cover disconnect reset and isVotingClosed matrix (#857) - #1023
Merged
k-deejah merged 1 commit intoOct 22, 2026
Merged
Conversation
|
@BernardOnuh 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #857
Why this PR exists
All three acceptance criteria of #857 were already satisfied on
mainbefore I started — the issue's dead stub premise is stale. Full audit with commit-by-commit evidence is in my comment on #857:src/components/GovernanceDashboard.tsxis not a<div>Governance Voting Dashboard</div>stub — it is a 709-line, fully documented implementation (typedGovernanceDashboardProps, proposal list, vote dialog, delegation panel) added inf86f69c1(Sep 26, @Dominion116) and hardened in25bf29c2(Oct 16, @samsondev23)GovernanceDashboard.test.tsx) — the latter landed after the issue was filed, which is likely why the issue stayed open: neither commit referenced GovernanceDashboard.tsx is dead code — stub, not exported, no tests #857Since there is no production code to change (deleting the component or downgrading its tests to
it.todowould remove working code), this PR gives the issue a reviewable, linked diff by adding regression coverage for two behaviours that were genuinely untested.AC status
mainbefore this PRsrc/components/index.ts:248-253+ 19 real tests (supersedes anit.todostub)exports.test.tsupdated accordinglysrc/__tests__/exports.test.tsasserts the component and all 4 exported types;src/components/exports.test.tssmoke-tests the barrelsrc/screens/Dashboard.tsx, README (×2),src/verify-exports.ts—git grepconfirms every reference resolvesWhat was changed, why, and how
File:
src/components/GovernanceDashboard.test.tsx(test only, +43/−1)clears stale proposals and the delegate when the wallet disconnects) — the component has a wallet-disconnect effect that clears stale proposals and the cached delegate so they don't linger after account reset (it even carries a comment saying it mirrorsSorokitProvider's account-reset effect). Nothing tested it: the test renders with a connected wallet, asserts proposals and the current delegate are shown, flips the mockedisConnectedtofalse, re-renders, and asserts the proposals are gone, the "Connect your wallet" prompt appears, and the delegate panel falls back toNone — voting for yourself.isVotingClosedmatrix (returns true only for terminal statuses) — the exported helper gates all vote buttons but was only exercised indirectly for a single status. The test pins the full contract:closed/executed/passed/rejected→true,active/pending→false.No changes to
GovernanceDashboard.tsxitself.Testing
vitest run src/components/GovernanceDashboard.test.tsx→ 21/21 passed (19 pre-existing + 2 new)vitest run(full suite) → 100 files / 2036 tests passedeslint . --ext .ts,.tsx→ cleantsc -b --noEmit→ clean