@gtkx/testing 0.4.1 → 0.5.0
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/dist/types.d.ts +14 -14
- package/dist/user-event.d.ts +2 -2
- package/package.json +4 -4
package/dist/types.d.ts
CHANGED
|
@@ -14,16 +14,16 @@ export type TextMatch = string | RegExp | TextMatchFunction;
|
|
|
14
14
|
/**
|
|
15
15
|
* Options for normalizing text before comparison.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type NormalizerOptions = {
|
|
18
18
|
/** Whether to trim whitespace from text. Defaults to true. */
|
|
19
19
|
trim?: boolean;
|
|
20
20
|
/** Whether to collapse multiple whitespace into single spaces. Defaults to true. */
|
|
21
21
|
collapseWhitespace?: boolean;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
/**
|
|
24
24
|
* Options for text matching in queries.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type TextMatchOptions = {
|
|
27
27
|
/** Whether to match the entire string exactly. Defaults to true. */
|
|
28
28
|
exact?: boolean;
|
|
29
29
|
/**
|
|
@@ -37,11 +37,11 @@ export interface TextMatchOptions {
|
|
|
37
37
|
collapseWhitespace?: boolean;
|
|
38
38
|
/** Maximum time in milliseconds to wait for a match. */
|
|
39
39
|
timeout?: number;
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
/**
|
|
42
42
|
* Options for querying elements by their accessible role.
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
44
|
+
export type ByRoleOptions = TextMatchOptions & {
|
|
45
45
|
/** Filter by the element's accessible name. Supports string, RegExp, or function matcher. */
|
|
46
46
|
name?: TextMatch;
|
|
47
47
|
/** Filter checkboxes/switches by checked state. */
|
|
@@ -54,22 +54,22 @@ export interface ByRoleOptions extends TextMatchOptions {
|
|
|
54
54
|
expanded?: boolean;
|
|
55
55
|
/** Filter headings by their level (1-6). */
|
|
56
56
|
level?: number;
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
58
|
/**
|
|
59
59
|
* Options for waitFor and related async utilities.
|
|
60
60
|
*/
|
|
61
|
-
export
|
|
61
|
+
export type WaitForOptions = {
|
|
62
62
|
/** Maximum time in milliseconds to wait. Defaults to 1000ms. */
|
|
63
63
|
timeout?: number;
|
|
64
64
|
/** Interval in milliseconds between condition checks. Defaults to 50ms. */
|
|
65
65
|
interval?: number;
|
|
66
66
|
/** Custom error handler called when timeout is reached. */
|
|
67
67
|
onTimeout?: (error: Error) => Error;
|
|
68
|
-
}
|
|
68
|
+
};
|
|
69
69
|
/**
|
|
70
70
|
* Options for the render function.
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
72
|
+
export type RenderOptions = {
|
|
73
73
|
/**
|
|
74
74
|
* Controls how the rendered element is wrapped.
|
|
75
75
|
* - `true` (default): Wrap in ApplicationWindow
|
|
@@ -79,12 +79,12 @@ export interface RenderOptions {
|
|
|
79
79
|
wrapper?: boolean | ComponentType<{
|
|
80
80
|
children: ReactNode;
|
|
81
81
|
}>;
|
|
82
|
-
}
|
|
82
|
+
};
|
|
83
83
|
/**
|
|
84
84
|
* Query methods bound to a specific container. All queries return promises
|
|
85
85
|
* that resolve when a matching element is found or reject on timeout.
|
|
86
86
|
*/
|
|
87
|
-
export
|
|
87
|
+
export type BoundQueries = {
|
|
88
88
|
/** Find a single element by its accessible role. */
|
|
89
89
|
findByRole: (role: AccessibleRole, options?: ByRoleOptions) => Promise<Gtk.Widget>;
|
|
90
90
|
/** Find a single element by its associated label text. */
|
|
@@ -101,12 +101,12 @@ export interface BoundQueries {
|
|
|
101
101
|
findAllByText: (text: TextMatch, options?: TextMatchOptions) => Promise<Gtk.Widget[]>;
|
|
102
102
|
/** Find all elements with matching test ID. */
|
|
103
103
|
findAllByTestId: (testId: TextMatch, options?: TextMatchOptions) => Promise<Gtk.Widget[]>;
|
|
104
|
-
}
|
|
104
|
+
};
|
|
105
105
|
/**
|
|
106
106
|
* The result returned by the render function. Includes query methods
|
|
107
107
|
* and utilities for interacting with the rendered component.
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
109
|
+
export type RenderResult = BoundQueries & {
|
|
110
110
|
/** The GTK Application instance containing the rendered component. */
|
|
111
111
|
container: Gtk.Application;
|
|
112
112
|
/** Unmount the rendered component and clean up resources. */
|
|
@@ -115,4 +115,4 @@ export interface RenderResult extends BoundQueries {
|
|
|
115
115
|
rerender: (element: ReactNode) => Promise<void>;
|
|
116
116
|
/** Print the current widget tree to the console for debugging. */
|
|
117
117
|
debug: () => void;
|
|
118
|
-
}
|
|
118
|
+
};
|
package/dist/user-event.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import type * as Gtk from "@gtkx/ffi/gtk";
|
|
|
2
2
|
/**
|
|
3
3
|
* Options for the tab user event.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type TabOptions = {
|
|
6
6
|
/** If true, navigates backwards (Shift+Tab behavior). */
|
|
7
7
|
shift?: boolean;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
9
|
/**
|
|
10
10
|
* Simulates user interactions with GTK widgets. Provides methods that mimic
|
|
11
11
|
* real user behavior like clicking, typing, and clearing input fields.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/testing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Testing utilities for GTKX applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtk",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@gtkx/native": "0.
|
|
36
|
-
"@gtkx/ffi": "0.
|
|
37
|
-
"@gtkx/react": "0.
|
|
35
|
+
"@gtkx/native": "0.5.0",
|
|
36
|
+
"@gtkx/ffi": "0.5.0",
|
|
37
|
+
"@gtkx/react": "0.5.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsc -b && cp ../../README.md .",
|