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:
Describe the bug
When running snapshot tests, if the view being tested uses the SwiftUI
.onOpenURL
modifier, a warning is produced that reads: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
1.9.0
13.2.1 (13C100)
5
iOS 15