test(ensemble): cover progress timer dispose and ListView scroll APIs#2242
Draft
cursor[bot] wants to merge 1 commit into
Draft
test(ensemble): cover progress timer dispose and ListView scroll APIs#2242cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Add widget tests for EnsembleProgressIndicator countdown timer cleanup after dispose (regression guard for 07e1786) and for ListViewController scrollToOffset/scrollToTop behavior added in scrollToOffset work. Co-authored-by: Sharjeel Yunus <sharjeelyunus@users.noreply.github.com>
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.
Risky behavior now covered
07e1786b): EnsurescountdownTimerandmainTimerare cancelled when the widget is removed from the tree, preventing post-disposesetStateand leaked periodic timers.4f5052b1/ scroll helpers): VerifiesscrollToOffsetis a safe no-op without scroll clients, jumps to a pixel offset when not animated, andscrollToTopresets offset to zero.Test files added/updated
modules/ensemble/test/widget/progress_indicator_test.dart(new)modules/ensemble/test/widget/list_view_test.dart(extended)Why these tests materially reduce regression risk
Progress countdown uses two concurrent timers; the prior bug left
mainTimerrunning after dispose and calledsetStateon an unmounted widget. A widget test that unmounts the indicator and advances time past the countdown catches timer leaks immediately.scrollToOffset/scrollToTopare invoked from YAML/script and must not throw when the list is not laid out yet, and must move the attachedScrollControllerwhen clients exist. These tests lock in the controller guard and scroll behavior without brittle layout snapshots.Validation
All new tests pass. (An existing footer-scope ListView test in the same file can fail independently of this change.)