@gtkx/native 0.1.33 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/index.node +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,10 +119,12 @@ import { AccessibleRole } from "@gtkx/ffi/gtk";
|
|
|
119
119
|
import { App } from "./app.js";
|
|
120
120
|
|
|
121
121
|
// Clean up after each test
|
|
122
|
-
afterEach(() =>
|
|
122
|
+
afterEach(async () => {
|
|
123
|
+
await cleanup();
|
|
124
|
+
});
|
|
123
125
|
|
|
124
126
|
test("increments count when clicking button", async () => {
|
|
125
|
-
render(<App />);
|
|
127
|
+
await render(<App />);
|
|
126
128
|
|
|
127
129
|
const button = await screen.findByRole(AccessibleRole.BUTTON, {
|
|
128
130
|
name: "Increment",
|
|
@@ -132,8 +134,8 @@ test("increments count when clicking button", async () => {
|
|
|
132
134
|
await screen.findByText("Count: 1");
|
|
133
135
|
});
|
|
134
136
|
|
|
135
|
-
test("can also use fireEvent for
|
|
136
|
-
render(<App />);
|
|
137
|
+
test("can also use fireEvent for low-level events", async () => {
|
|
138
|
+
await render(<App />);
|
|
137
139
|
|
|
138
140
|
const button = await screen.findByRole(AccessibleRole.BUTTON, {
|
|
139
141
|
name: "Increment",
|
|
@@ -146,10 +148,8 @@ test("can also use fireEvent for synchronous events", async () => {
|
|
|
146
148
|
|
|
147
149
|
### Available APIs
|
|
148
150
|
|
|
149
|
-
**Queries** - Find elements in the rendered tree:
|
|
150
|
-
- `
|
|
151
|
-
- `queryBy*` / `queryAllBy*` - Returns null/empty array if not found
|
|
152
|
-
- `findBy*` / `findAllBy*` - Async, waits for element
|
|
151
|
+
**Queries** - Find elements in the rendered tree (all async):
|
|
152
|
+
- `findBy*` / `findAllBy*` - Waits for element to appear
|
|
153
153
|
|
|
154
154
|
Query types: `ByRole`, `ByText`, `ByLabelText`, `ByTestId`
|
|
155
155
|
|
package/dist/index.node
CHANGED
|
Binary file
|