@gtkx/testing 0.1.35 → 0.1.36
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/queries.js +6 -6
- package/dist/render.js +2 -1
- package/package.json +4 -4
package/dist/queries.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getObject } from "@gtkx/ffi";
|
|
2
2
|
import { AccessibleRole, Button, CheckButton, Expander, Label, ToggleButton } from "@gtkx/ffi/gtk";
|
|
3
3
|
import { findAll } from "./traversal.js";
|
|
4
4
|
import { waitFor } from "./wait-for.js";
|
|
@@ -18,11 +18,11 @@ const matchText = (actual, expected, options) => {
|
|
|
18
18
|
}
|
|
19
19
|
return expected.test(normalizedActual);
|
|
20
20
|
};
|
|
21
|
-
const asButton = (widget) =>
|
|
22
|
-
const asLabel = (widget) =>
|
|
23
|
-
const asCheckButton = (widget) =>
|
|
24
|
-
const asToggleButton = (widget) =>
|
|
25
|
-
const asExpander = (widget) =>
|
|
21
|
+
const asButton = (widget) => getObject(widget.ptr, Button);
|
|
22
|
+
const asLabel = (widget) => getObject(widget.ptr, Label);
|
|
23
|
+
const asCheckButton = (widget) => getObject(widget.ptr, CheckButton);
|
|
24
|
+
const asToggleButton = (widget) => getObject(widget.ptr, ToggleButton);
|
|
25
|
+
const asExpander = (widget) => getObject(widget.ptr, Expander);
|
|
26
26
|
const isInternalLabel = (widget) => {
|
|
27
27
|
const accessible = widget;
|
|
28
28
|
if (accessible.getAccessibleRole() !== AccessibleRole.LABEL)
|
package/dist/render.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as Gtk from "@gtkx/ffi/gtk";
|
|
|
4
4
|
import { ApplicationWindow, reconciler } from "@gtkx/react";
|
|
5
5
|
import * as queries from "./queries.js";
|
|
6
6
|
import { setScreenRoot } from "./screen.js";
|
|
7
|
+
const ROOT_NODE_CONTAINER = Symbol.for("ROOT_NODE_CONTAINER");
|
|
7
8
|
const APP_ID = "com.gtkx.testing";
|
|
8
9
|
let container = null;
|
|
9
10
|
const hasGetLabel = (widget) => typeof widget.getLabel === "function";
|
|
@@ -29,7 +30,7 @@ const ensureInitialized = () => {
|
|
|
29
30
|
const app = start(APP_ID);
|
|
30
31
|
if (!container) {
|
|
31
32
|
const instance = reconciler.getInstance();
|
|
32
|
-
container = instance.createContainer(
|
|
33
|
+
container = instance.createContainer(ROOT_NODE_CONTAINER, 0, null, false, null, "", (error) => console.error("Test reconciler error:", error), () => { }, () => { }, () => { }, null);
|
|
33
34
|
}
|
|
34
35
|
return { app, container };
|
|
35
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/testing",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
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/
|
|
36
|
-
"@gtkx/react": "0.1.
|
|
37
|
-
"@gtkx/
|
|
35
|
+
"@gtkx/native": "0.1.36",
|
|
36
|
+
"@gtkx/react": "0.1.36",
|
|
37
|
+
"@gtkx/ffi": "0.1.36"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsc -b && cp ../../README.md .",
|