Skip to content

test(ensemble): regression tests for Page dispose and ListViewCore scroll rebinding#2244

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-c987
Draft

test(ensemble): regression tests for Page dispose and ListViewCore scroll rebinding#2244
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-c987

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 31, 2026

Description

Adds unit/widget tests for two recent production fixes that lacked dedicated regression coverage.

Related Issue

Cron test-coverage automation (missing tests for merged fixes).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes) — test-only

What Has Changed

  • modules/ensemble/test/page_header_dispose_test.dart — Verifies PageState tears down collapsible-header storage poll timers on dispose without setState-after-dispose errors when timers would fire post-unmount (regression for #2c45e427).
  • modules/ensemble/test/widget/list_view_core_test.dart — Verifies ListViewCore rebinds CustomScrollView.controller when scrollController is swapped at runtime and disposes the implicit controller when switching to an external one (regression for #c792a8a6).

Risky behavior now covered

  1. Page header lifecycle — Uncancelled Timer.periodic callbacks and duplicate storage ModelChangeEvent listeners could leak resources or call setState after dispose.
  2. ListView scroll controller sync — Stale ScrollController on CustomScrollView after parent retargets controller (e.g. FooterScope) caused scroll position drift and disposed-controller use.

How to Test

  1. cd modules/ensemble && flutter test test/page_header_dispose_test.dart test/widget/list_view_core_test.dart
  2. Confirm both tests pass.

Checklist

  • I have run flutter analyze and addressed any new warnings
  • I have run flutter test and all tests pass (targeted new tests)
  • I have tested my changes on the relevant platform(s)
  • I have updated documentation if needed
  • My changes do not introduce new warnings or errors
Open in Web View Automation 

… swap

Add regression tests for recent fixes:
- PageState must cancel collapsible-header poll timers on dispose without
  setState-after-dispose errors when timers would have fired post-unmount.
- ListViewCore must rebind CustomScrollView and dispose implicit controllers
  when scrollController changes at runtime.

Co-authored-by: Sharjeel Yunus <sharjeelyunus@users.noreply.github.com>
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.

1 participant