test(ensemble): cover Page header listeners and ListViewCore scroll rebind#2243
Draft
cursor[bot] wants to merge 2 commits into
Draft
test(ensemble): cover Page header listeners and ListViewCore scroll rebind#2243cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
Add widget tests for the fix that deduped titleBarHeight storage event subscriptions and cancelled periodic poll timers on PageState dispose. Expose @VisibleForTesting getters so tests can assert a single stored subscription and that poll timers are torn down without leaking callbacks. Co-authored-by: Sharjeel Yunus <sharjeelyunus@users.noreply.github.com>
Assert ListViewCore rebinds its Scrollable when the parent ListView retargets to a different caller-provided controller, guarding the didUpdateWidget sync added in the ListViewCore scroll fix. 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.
Summary
Adds regression tests for two recent production fixes that shipped without full test coverage.
Risky behavior now covered
2c45e427):PageStatepreviously registered three duplicateModelChangeEventlisteners fortitleBarHeightstorage updates and never cancelled periodic poll timers on dispose. Tests assert a single stored subscription is created and that poll timers are cancelled cleanly when the page is removed.c792a8a6): When a caller-providedScrollControlleris swapped at runtime,ListViewCoremust rebind its internalScrollable(not only the publicListViewController). A widget test verifies theScrollable.controllertracks the new external controller.Test files added/updated
modules/ensemble/test/widget/page_header_storage_listeners_test.dart(new)modules/ensemble/lib/framework/view/page.dart—@visibleForTestinggetters for listener/timer state (no behavior change)modules/ensemble/test/widget/list_view_test.dart— external scroll controller swap caseWhy these tests materially reduce regression risk
ListViewControllerandListViewCorebreaks programmatic scroll APIs and footer handoff; the new test complements the existing footer-scope regression test.Validation
Both new tests pass. Note: the existing footer-scope ListView test appears flaky in this VM environment (also fails on
main); not introduced by this PR.