Replies: 1 comment 1 reply
-
Hi @spelaez, your code is producing purple runtime warnings letting you know that something isn't quite right:
You can fix this by making the model Overall I am seeing pretty deterministic test passes, but I understand it may be different for you. This may just be the reality of snapshot testing, which is not an exact science. We do have plans in the future to make You could emulate the async style of snapshot testing doing something like this: let view = ContentView(model: viewModel)
let controller = UIHostingController(rootView: view)
_ = controller.view
try await Task.sleep(for: .seconds(0.03))
assertSnapshot(
of: controller,
named: "\(density)"
) Since I don't feel this is directly an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there, or maybe others have tips they can share to help you out. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Using an image that is fetched asynchronously might won't show sometimes on the light mode snapshot variant
To Reproduce
This should repro mostly on a first run of the tests
There's an ImageProvider dependency that fetches an image in an async fashion
The test is provided with a version of this that returns an image immediately and the snapshots are captured with a
wait
of 0.1SnapshotsBug.zip
Expected behavior
Image should show always in the snapshots
Screenshots
Environment
Beta Was this translation helpful? Give feedback.
All reactions