test(ensemble): cover navigateViewGroup clamp and CDN stale refresh paths#2261
Draft
cursor[bot] wants to merge 1 commit into
Draft
test(ensemble): cover navigateViewGroup clamp and CDN stale refresh paths#2261cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…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>
1 task
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
navigateViewGroupindex resolution (0ce6723a): When a script passes an out-of-rangeviewIndex, the action must clamp beforePageController.jumpToPageto avoid assertion failures. Tests cover both the clamp path (known menu length) and the passthrough path (menu length unknown).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.dart—resolveNavigateViewGroupTabIndexcasesmodules/ensemble/test/cdn_provider_test.dart— CDN stale refresh immediate vs deferred outcomesWhy these tests materially reduce regression risk
jumpToPagecrashes are user-facing and hard to catch without integration tests; the extracted helper mirrors production logic exactly.Validation
All 14 tests in those files pass.