Skip to content

API Reference / @gtkx/testing / queryByObjectProperty

Function: queryByObjectProperty() ​

queryByObjectProperty(property, container, text, options?): Widget | null

Defined in: packages/testing/dist/query-helpers.d.ts:42

Returns the single widget carrying a GObject property whose value matches, or null when none do, the counterpart of DOM Testing Library's queryByAttribute.

Parameters ​

property ​

string

Name of the GObject property to read.

container ​

Container

Widget subtree to search.

text ​

Matcher

Matcher for the property's value.

options? ​

MatcherOptions

Text matching options.

Returns ​

Widget | null

The matching widget, or null when none match.

Throws ​

When more than one widget matches.

Released under the MPL-2.0 License.