@gtkx/testing / userEvent
Variable: userEvent
constuserEvent:object
Defined in: user-event.ts:393
User interaction utilities for testing.
Simulates user actions like clicking, typing, and selecting. All methods are async and wait for GTK event processing.
Type Declaration
Example
tsx
import { render, screen, userEvent } from "@gtkx/testing";
test("form submission", async () => {
await render(<LoginForm />);
const input = await screen.findByRole(Gtk.AccessibleRole.TEXT_BOX);
await userEvent.type(input, "username");
const button = await screen.findByRole(Gtk.AccessibleRole.BUTTON);
await userEvent.click(button);
});