Skip to content

@gtkx/testing

Functions

FunctionDescription
cleanupCleans up the rendered component tree.
configureConfigures the testing library behavior.
findAllByLabelTextFinds all elements matching label or text content.
findAllByNameFinds all elements matching a widget name pattern.
findAllByRoleFinds all elements matching an accessible role.
findAllByTextFinds all elements matching visible text content.
findByLabelTextFinds a single element that is labelled by a GtkLabel whose text matches.
findByNameFinds a single element by widget name.
findByRoleFinds a single element by accessible role.
findByTextFinds a single element by visible text content.
fireEventEmits a GTK signal on a widget or event controller.
getConfigReturns the current testing library configuration.
getRolesCollects all accessible roles and their widgets from a container.
logRolesLogs all accessible roles in a container to the console.
prettyRolesFormats roles into a readable string for error messages.
prettyWidgetFormats a widget tree as a readable string for debugging.
queryAllByLabelTextFinds all elements that are labelled by a GtkLabel whose text matches.
queryAllByNameFinds all elements matching a widget name without throwing.
queryAllByRoleFinds all elements matching a role without throwing.
queryAllByTextFinds all elements matching text content without throwing.
queryByLabelTextFinds a single element matching label text without throwing.
queryByNameFinds a single element matching a widget name without throwing.
queryByRoleFinds a single element matching a role without throwing.
queryByTextFinds a single element matching text content without throwing.
renderRenders a React element for testing.
renderHookRenders a React hook for testing.
screenshotCaptures a screenshot of a GTK widget as a PNG image.
tickYields to the event loop, allowing pending GTK events to process.
waitForWaits for a callback to succeed.
waitForElementToBeRemovedWaits for an element to be removed from the widget tree.
withinCreates scoped query methods for a container widget.

Type Aliases

Type AliasDescription
BoundQueriesQuery methods bound to a container.
ByRoleOptionsOptions for role-based queries.
ConfigConfiguration options for the testing library.
ContainerRoot element for scoping queries.
NormalizerOptionsOptions for text normalization before matching.
PointerInputPointer input actions for simulating mouse interactions.
PrettyWidgetOptionsOptions for prettyWidget.
RenderHookOptionsOptions for renderHook.
RenderHookResultResult returned by renderHook.
RenderOptionsOptions for render.
RenderResultResult returned by render.
RoleInfoInformation about a widget and its accessible name.
ScreenshotOptionsOptions for capturing widget screenshots.
ScreenshotResultResult returned by screenshot and screen.screenshot.
TabOptionsOptions for tab navigation.
TextMatchText matching pattern.
TextMatchFunctionCustom function for matching text content.
TextMatchOptionsOptions for text-based queries.
WaitForOptionsOptions for waitFor and waitForElementToBeRemoved.
WrapperComponentA 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

VariableDescription
screenGlobal query object for accessing rendered components.
userEventUser interaction utilities for testing.