Skip to content

test(ensemble): cover navigateViewGroup clamp and CDN stale refresh paths#2261

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

test(ensemble): cover navigateViewGroup clamp and CDN stale refresh paths#2261
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-dc66

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Jun 6, 2026

Risky behavior now covered

  • navigateViewGroup index resolution (0ce6723a): When a script passes an out-of-range viewIndex, the action must clamp before PageController.jumpToPage to avoid assertion failures. Tests cover both the clamp path (known menu length) and the passthrough path (menu length unknown).
  • CDN stale-refresh race condition (19b50b2e): After a background CDN fetch updates the manifest, the provider must either apply changes immediately (artifact refresh enabled + app initialized) or defer to resume. Tests lock in both branches so the cold-start vs deferred behavior cannot regress.

Test files added/updated

  • modules/ensemble/test/safe_view_group_payload_index_test.dartresolveNavigateViewGroupTabIndex cases
  • modules/ensemble/test/cdn_provider_test.dart — CDN stale refresh immediate vs deferred outcomes

Why these tests materially reduce regression risk

  • Navigation: jumpToPage crashes are user-facing and hard to catch without integration tests; the extracted helper mirrors production logic exactly.
  • CDN updates: The race fix depends on ordering (bundle update before refresh event) and on choosing the correct apply/defer branch; unit tests assert bundle version and pending-flag state without network or lifecycle flakiness.

Validation

flutter test test/safe_view_group_payload_index_test.dart test/cdn_provider_test.dart

All 14 tests in those files pass.

Open in Web View Automation 

…aths

Extract resolveNavigateViewGroupTabIndex and applyStaleRefreshOutcome
helpers so recent navigation and CDN race-condition fixes have direct
unit coverage without widget or network dependencies.

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