Skip to content

Async view inspection in combination with evironment #354

Answered by nalexn
adusak asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, yeah, I found this isn't properly documented, so you can do

let sut = MyView()
try await ViewHosting.host(sut.environment(\.test, Test()) { _ in
    try await sut.inspection.inspect { view in
        #expect(throws: Never.self) {
            _ = try view.find(viewWithAccessibilityIdentifier: a11yIdEmptyJobListText)
            _ = try view.find(text: "empty text")
        }
    }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@adusak
Comment options

@nalexn
Comment options

Answer selected by adusak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants