pointfreeco / swift-snapshot-testing

📸 Delightful Swift snapshot testing.
https://www.pointfree.co/episodes/ep41-a-tour-of-snapshot-testing
MIT License
3.68k stars 556 forks source link

Cannot use Scene methods for URL, NSUserActivity, and other External Events without using SwiftUI Lifecycle Warning #583

Open slhodson969 opened 2 years ago

slhodson969 commented 2 years ago

Describe the bug

When running snapshot tests, if the view being tested uses the SwiftUI .onOpenURL modifier, a warning is produced that reads:

Cannot use Scene methods for URL, NSUserActivity, and other External Events without using SwiftUI Lifecycle. Without SwiftUI Lifecycle, advertising and handling External Events wastes resources, and will have unpredictable results.

To Reproduce Zipped up a very basic project that reproduces the behavior:

snapshot-demo-app-main.zip

Expected behavior We should not receive any warning

Environment

mbrandonw commented 2 years ago

This doesn't appear to be an issue with the library that we can control, so I am going to convert this to a discussion.