Skip to content
New issue

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

Provide access to a TextField’s prompt #259

Closed
grantneufeld opened this issue Sep 21, 2023 Discussed in #258 · 1 comment
Closed

Provide access to a TextField’s prompt #259

grantneufeld opened this issue Sep 21, 2023 Discussed in #258 · 1 comment
Labels
feature request New feature or request

Comments

@grantneufeld
Copy link

Add an accessor for the prompt when inspecting a TextField.

Given code like the following:

struct MyView: View {
    @Binding var myText: String = ""
    var prompt: String = ""
    var body: some View {
        TextField("My Label", text: $myText, prompt: self.prompt)
    }
}

We would be able to do something like:

func test_promptIsCorrect() throws {
    var textBinding = Binding<String>(wrappedValue: "")
    let sut = MyView(prompt: "My Prompt")
    let prompt = try sut.inspect().view(MyView.self).textField().prompt()
    let promptText = try prompt.string()
    XCTAssertEqual(promptText, "My Prompt")
}

Discussed in #258

@nalexn nalexn added the feature request New feature or request label Sep 24, 2023
@nalexn nalexn added the pending release A fixed issue that'll be released in an upcoming update label Nov 10, 2023
@nalexn nalexn removed the pending release A fixed issue that'll be released in an upcoming update label Dec 3, 2023
@nalexn
Copy link
Owner

nalexn commented Dec 3, 2023

Released in v0.9.9

@nalexn nalexn closed this as completed Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants