Skip to content

test(events): cover mount fetch, contractId propagation and polling lifecycle for ContractEventFeed (Closes #558) - #631

Open
BernardOnuh wants to merge 1 commit into
Sorokit:mainfrom
BernardOnuh:issue#558
Open

test(events): cover mount fetch, contractId propagation and polling lifecycle for ContractEventFeed (Closes #558)#631
BernardOnuh wants to merge 1 commit into
Sorokit:mainfrom
BernardOnuh:issue#558

Conversation

@BernardOnuh

Copy link
Copy Markdown
Contributor

Closes #558.

What

Adds the two acceptance-criteria behaviors that ContractEventFeed.test.tsx was still missing. The file already covered list rendering, empty state, error state, initial-load skeleton, and pausing polling — so this PR fills the remaining gaps:

  • fetches events on mount with the contractId and the default limit — asserts the first call lands on mount with (CONTRACT_ID, 10, undefined) and fires exactly once, locking in the initial-fetch contract from the issue's Problem statement.
  • restarts polling when the Live/Paused toggle is turned back on — pauses (no new calls after advancing well past the interval), then resumes and verifies one new call fires per poll interval. The issue explicitly calls out "Live toggle stops and restarts polling"; only the stop half had tests.

Verification

The polling tests drive vi.useFakeTimers() + vi.advanceTimersByTime() against the component's setInterval(load, pollInterval) wiring.

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write tests for ContractEventFeed: initial load, polling, live toggle, error and empty states

2 participants