Skip to content

API Reference / @gtkx/testing / RenderOptions

Type Alias: RenderOptions<Q> ​

RenderOptions<Q> = object

Defined in: packages/testing/src/types.ts:173

Options for render: the container and base element to mount into, an optional wrapper, React behavior toggles, error callbacks, and custom queries to bind.

Type Parameters ​

Q ​

Q extends QueryMap = Record<never, never>

Properties ​

areAnimationsEnabled? ​

optional areAnimationsEnabled?: boolean

Defined in: packages/testing/src/types.ts:188

Enable widget animations during the test.


baseElement? ​

optional baseElement?: Container

Defined in: packages/testing/src/types.ts:182

Root of the subtree that bound queries search.


container? ​

optional container?: Gtk.Accessible | RootElement

Defined in: packages/testing/src/types.ts:180

Widget or root element to mount into; an undecorated harness window is created when omitted. A widget container that sits outside every toplevel, such as a bare Gtk.Box, keeps the tree out of reach of a pointer and a keyboard, so every userEvent helper aimed at it rejects after actionabilityTimeout; fireEvent drives such a tree instead.


isReactStrictMode? ​

optional isReactStrictMode?: boolean

Defined in: packages/testing/src/types.ts:186

Render inside React StrictMode.


onCaughtError? ​

optional onCaughtError?: (error, errorInfo) => void

Defined in: packages/testing/src/types.ts:190

Called for errors caught by React error boundaries.

Parameters ​

error ​

unknown

errorInfo ​

CaughtErrorInfo

Returns ​

void


onRecoverableError? ​

optional onRecoverableError?: (error, errorInfo) => void

Defined in: packages/testing/src/types.ts:192

Called for errors React recovered from automatically.

Parameters ​

error ​

unknown

errorInfo ​

ErrorInfo

Returns ​

void


queries? ​

optional queries?: Q

Defined in: packages/testing/src/types.ts:194

Custom queries to bind to the rendered result.


wrapper? ​

optional wrapper?: WrapperComponent

Defined in: packages/testing/src/types.ts:184

Component wrapped around the rendered element, such as a context provider.