Add a UI test for escaped ViewStore
from WithViewStore
, and a Binding
animations test bench
#1819
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.
This adds a test case for
ViewStore
fromWithViewStore
being escaped. We're taking measures to propagate the invalidation, but this should assert that they're still effective ifWithViewStore
implementation changes.The test checks simultaneously a capture by a
GeometryReader
, and by someStepper
'sonIncrement
. Both issues were solved by the same solution, but it is not exactly clear why theStepper
's escape was causing an issue, so I feel it is better to check both. Because they share the same fix, they're tested in the same UITest though. I've also checked that each would spot a regression by reverting theViewStore
copy inWithViewStore
.I've also added a
Binding
animations test bench. This is not checked automatically, but this puts side to side binding animations from a VanillaObservedObject
and from aViewStore
. Various configurations are presented, so one can quickly check if the binding is animating with the same animations as the vanilla model.Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-01-11.at.00.15.45.mp4
It is maybe possible to programmatically check that things are indeed animating, but I didn't investigate farther yet. This
Bindings
test bench can be removed from the PR if you prefer this keep this target for automated tests only. Let me know what you think!