@gtkx/testing 0.2.2 → 0.2.4

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/render.js CHANGED
@@ -44,7 +44,14 @@ const ensureInitialized = () => {
44
44
  return { app, container };
45
45
  };
46
46
  const DefaultWrapper = ({ children }) => (_jsx(ApplicationWindow, { children: children }));
47
- const wrapElement = (element, Wrapper = DefaultWrapper) => (_jsx(Wrapper, { children: element }));
47
+ const wrapElement = (element, wrapper = true) => {
48
+ if (wrapper === false)
49
+ return element;
50
+ if (wrapper === true)
51
+ return _jsx(DefaultWrapper, { children: element });
52
+ const Wrapper = wrapper;
53
+ return _jsx(Wrapper, { children: element });
54
+ };
48
55
  /**
49
56
  * Renders a React element into a GTK application for testing.
50
57
  * @param element - The React element to render
package/dist/types.d.ts CHANGED
@@ -44,8 +44,13 @@ export interface WaitForOptions {
44
44
  * Options for the render function.
45
45
  */
46
46
  export interface RenderOptions {
47
- /** A React component to wrap the rendered element. Useful for providing context. */
48
- wrapper?: ComponentType<{
47
+ /**
48
+ * Controls how the rendered element is wrapped.
49
+ * - `true` (default): Wrap in ApplicationWindow
50
+ * - `false`: No wrapping, render element as-is
51
+ * - Component: Use a custom wrapper component
52
+ */
53
+ wrapper?: boolean | ComponentType<{
49
54
  children: ReactNode;
50
55
  }>;
51
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/testing",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
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/ffi": "0.2.2",
36
- "@gtkx/native": "0.2.2",
37
- "@gtkx/react": "0.2.2"
35
+ "@gtkx/ffi": "0.2.4",
36
+ "@gtkx/react": "0.2.4",
37
+ "@gtkx/native": "0.2.4"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsc -b && cp ../../README.md .",