ByPlaceholderText

Although not as useful as other queries (like getByLabelText()), sometimes the only way to select an input is by its placeholder value.

In those cases, getByPlaceholderText() is an easy to use RTL query.

Loading full lesson content & code...

Share this lessonTweet (X) it

Invite a teammate to learn with you by sharing this lesson or dropping the link in your team chat.

Ready to try running tests for this lesson?