test(ios-readplace): extract per-item routing and web 4xx policy into tested seams#924
Closed
FagnerMartinsBrack wants to merge 2 commits into
Closed
test(ios-readplace): extract per-item routing and web 4xx policy into tested seams#924FagnerMartinsBrack wants to merge 2 commits into
FagnerMartinsBrack wants to merge 2 commits into
Conversation
… tested seams Two behavioural decisions were embedded in SwiftUI/WebKit glue with no unit-test seam, unlike their already-extracted twins (`ToolbarRoute`, `HTMLCaptor.navigationResponseDecision`): - `ItemRoute` lifts the per-item routing out of `ReadingListView.activate` — a link opens, a destructive action confirms, any other action invokes — so the contract-relevant behaviours (a link-only item control opens rather than being dropped; a destructive control never invokes without confirmation) are unit-tested without a view. - `WebResponsePolicy` lifts the "a 4xx/5xx status is a failure" rule out of the `WebPageView` navigation delegate (WKWebView delivers error statuses through `didFinish`, so the web view would otherwise paint the error body), tested at the 399/400 boundary. Both new files are gated at 100%; the views keep only their effect/plumbing.
Member
Author
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.
Purpose
Two behavioural decisions lived inside SwiftUI/WebKit glue with no unit-test seam, unlike their already-extracted twins (
ToolbarRoute,HTMLCaptor.navigationResponseDecision). This extracts them into pure, gated values, leaving the views with only their effect/plumbing.What changed & the value
ItemRoutelifts the per-item routing out ofReadingListView.activate: a link opens, a destructive action confirms, any other action invokes. The contract-relevant behaviours — a link-only item control opens rather than being silently dropped, and a destructive control never invokes without a confirmation — are now unit-tested without standing up a view. MirrorsToolbarRouteexactly.WebResponsePolicylifts the "a 4xx/5xx status is a failure" rule out of theWebPageViewnavigation delegate. WKWebView delivers error statuses throughdidFinish(notdidFail), so the web view would otherwise paint the server's error body; the policy is tested at the 399/400 boundary.Both new files are gated at 100% (the coverage gate requires a new logic file to be fully covered);
ReadingListViewandWebPageViewkeep only their effect/plumbing and stay in the OS-boundary exclusions.Testing
Full suite green with the gate (249 tests, +7;
iOS coverage gate passed: 23 files at or above floor, 9 excluded), plus the STAGING smoke pass.