Skip to content

API Reference / @gtkx/testing / getQueriesForElement

Function: getQueriesForElement() ​

getQueriesForElement<Q>(container, queries?): QueryFamily<"Role", "role", []> & QueryFamily<"LabelText", "text", []> & QueryFamily<"Text", "text", []> & QueryFamily<"Name", "name", []> & QueryFamily<"PlaceholderText", "text", []> & QueryFamily<"DisplayValue", "value", []> & BoundCustomQueries<Q>

Defined in: packages/testing/src/within.ts:26

Binds the built-in queries, and any custom queries, to a specific container so they search only within that scope. Also exported as getQueriesForElement, which reads better in library code.

Type Parameters ​

Q ​

Q extends QueryMap = Record<never, never>

Parameters ​

container ​

Container

The scope the returned queries operate on.

queries? ​

Q

Optional custom queries to bind alongside the built-in ones.

Returns ​

QueryFamily<"Role", "role", []> & QueryFamily<"LabelText", "text", []> & QueryFamily<"Text", "text", []> & QueryFamily<"Name", "name", []> & QueryFamily<"PlaceholderText", "text", []> & QueryFamily<"DisplayValue", "value", []> & BoundCustomQueries<Q>

The queries bound to the container.