[QoL] Allow RenderTester to recover and continue from missing AnyScreen-producing child workflows #150
+98
−3
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.
AnyScreen
is opaque and we can easily construct one to return from RenderTester's test RenderContext in situations where a child workflow that renders anAnyScreen
hasn't beenexpect
ed (and thus we've been given no value to return) but one is rendered. This still fails the tests, but allows it to continue rather than crashing.One thing this does is add a dependency from WorkflowTesting to WorkflowUI. Are we okay with that?
If we like this overall approach, we could also consider adding paths for other types we're able to construct like
String
,Int
, etc. (even though I think it's actually pretty rare that people actually use these types of types as renderings in practice).(I also tried to make the message in the case were we do crash a little less terse (explaining a bit of why we have to crash))
Checklist
UI Tests(N/A)Snapshot Tests (iOS only)(N/A)I have made corresponding changes to the documentation(N/A)