Closed rishipandey closed 3 days ago
@rishipandey You can resolve this by adding .view(TestListView.self)
after calling .inspect()
. I'm unsure why this is now required.
So in your example, you would write let list = try view.inspect().view(TestListView.self).list()
The above comment by @Tronicnotes is correct, I would just add that you can alternatively use find
:
let list = try view.inspect().find(ViewType.List.self)
have created a sample view with a List in XCode 16:
Now, I have created inspection tests:
However, these tests throw the following error:
failed: caught error: "list() found TestApp_SwiftUI.TestListView instead of List"