Skip to content
masterclass Buddy

React Testing Library · Module

queryByDisplayValue

Find a form control by its current displayed value. queryByDisplayValue returns null when there is no match, so it is useful for optional elements.

Last updated

Syntax

queryByDisplayValue(value, options?)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • getByDisplayValue
  • getAllByDisplayValue
  • queryAllByDisplayValue
  • findByDisplayValue
  • findAllByDisplayValue
  • screen

Source: ByDisplayValue | Testing Library. Checked 2026-11-03.