We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
have created a sample view with a List in XCode 16:
struct TestListView: View { let items = ["Item 1", "Item 2", "Item 3"] var body: some View { List { ForEach(items, id: \.self) { item in Text(item) } } } }
Now, I have created inspection tests:
final class TestListViewTests: XCTestCase { func testListItemCount() throws { let view = TestListView() let list = try view.inspect().list() let forEach = try list.forEach(0) XCTAssertEqual(forEach.count, 3) } func testListItemContents() throws { let view = TestListView() let list = try view.inspect().list() let forEach = try list.forEach(0) XCTAssertEqual(try forEach[0].text().string(), "Item 1") XCTAssertEqual(try forEach[1].text().string(), "Item 2") XCTAssertEqual(try forEach[2].text().string(), "Item 3") } }
However, these tests throw the following error: failed: caught error: "list() found TestApp_SwiftUI.TestListView instead of List"
failed: caught error: "list() found TestApp_SwiftUI.TestListView instead of List"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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"
The text was updated successfully, but these errors were encountered: