@gtkx/testing
Functions
| Function | Description |
|---|---|
| cleanup | Cleans up the rendered component tree. |
| configure | Configures the testing library behavior. |
| findAllByLabelText | Finds all elements matching label or text content. |
| findAllByName | Finds all elements matching a widget name pattern. |
| findAllByRole | Finds all elements matching an accessible role. |
| findAllByText | Finds all elements matching visible text content. |
| findByLabelText | Finds a single element that is labelled by a GtkLabel whose text matches. |
| findByName | Finds a single element by widget name. |
| findByRole | Finds a single element by accessible role. |
| findByText | Finds a single element by visible text content. |
| fireEvent | Emits a GTK signal on a widget or event controller. |
| getConfig | Returns the current testing library configuration. |
| getRoles | Collects all accessible roles and their widgets from a container. |
| logRoles | Logs all accessible roles in a container to the console. |
| prettyRoles | Formats roles into a readable string for error messages. |
| prettyWidget | Formats a widget tree as a readable string for debugging. |
| queryAllByLabelText | Finds all elements that are labelled by a GtkLabel whose text matches. |
| queryAllByName | Finds all elements matching a widget name without throwing. |
| queryAllByRole | Finds all elements matching a role without throwing. |
| queryAllByText | Finds all elements matching text content without throwing. |
| queryByLabelText | Finds a single element matching label text without throwing. |
| queryByName | Finds a single element matching a widget name without throwing. |
| queryByRole | Finds a single element matching a role without throwing. |
| queryByText | Finds a single element matching text content without throwing. |
| render | Renders a React element for testing. |
| renderHook | Renders a React hook for testing. |
| screenshot | Captures a screenshot of a GTK widget as a PNG image. |
| tick | Yields to the event loop, allowing pending GTK events to process. |
| waitFor | Waits for a callback to succeed. |
| waitForElementToBeRemoved | Waits for an element to be removed from the widget tree. |
| within | Creates scoped query methods for a container widget. |
Type Aliases
| Type Alias | Description |
|---|---|
| BoundQueries | Query methods bound to a container. |
| ByRoleOptions | Options for role-based queries. |
| Config | Configuration options for the testing library. |
| Container | Root element for scoping queries. |
| NormalizerOptions | Options for text normalization before matching. |
| PointerInput | Pointer input actions for simulating mouse interactions. |
| PrettyWidgetOptions | Options for prettyWidget. |
| RenderHookOptions | Options for renderHook. |
| RenderHookResult | Result returned by renderHook. |
| RenderOptions | Options for render. |
| RenderResult | Result returned by render. |
| RoleInfo | Information about a widget and its accessible name. |
| ScreenshotOptions | Options for capturing widget screenshots. |
| ScreenshotResult | Result returned by screenshot and screen.screenshot. |
| TabOptions | Options for tab navigation. |
| TextMatch | Text matching pattern. |
| TextMatchFunction | Custom function for matching text content. |
| TextMatchOptions | Options for text-based queries. |
| WaitForOptions | Options for waitFor and waitForElementToBeRemoved. |
| WrapperComponent | A wrapper component that exposes its root GTK widget via ref. Accept ref as a prop and pass it through to the root intrinsic element. |
Variables
| Variable | Description |
|---|---|
| screen | Global query object for accessing rendered components. |
| userEvent | User interaction utilities for testing. |