@gtkx/testing 0.21.0 → 1.0.0-rc.2
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 +137 -34
- package/dist/act.d.ts +19 -0
- package/dist/act.d.ts.map +1 -0
- package/dist/act.js +56 -0
- package/dist/act.js.map +1 -0
- package/dist/bound-queries.d.ts +33 -0
- package/dist/bound-queries.d.ts.map +1 -0
- package/dist/bound-queries.js +2 -0
- package/dist/bound-queries.js.map +1 -0
- package/dist/build-queries.d.ts +16 -0
- package/dist/build-queries.d.ts.map +1 -0
- package/dist/build-queries.js +115 -0
- package/dist/build-queries.js.map +1 -0
- package/dist/cleanup-registry.d.ts +5 -0
- package/dist/cleanup-registry.d.ts.map +1 -0
- package/dist/cleanup-registry.js +21 -0
- package/dist/cleanup-registry.js.map +1 -0
- package/dist/config.d.ts +20 -52
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +17 -46
- package/dist/config.js.map +1 -1
- package/dist/editable.d.ts +8 -0
- package/dist/editable.d.ts.map +1 -0
- package/dist/editable.js +26 -0
- package/dist/editable.js.map +1 -0
- package/dist/errors.d.ts +30 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +135 -0
- package/dist/errors.js.map +1 -0
- package/dist/fire-event.d.ts +8 -25
- package/dist/fire-event.d.ts.map +1 -1
- package/dist/fire-event.js +11 -30
- package/dist/fire-event.js.map +1 -1
- package/dist/frame-sync.d.ts +4 -0
- package/dist/frame-sync.d.ts.map +1 -0
- package/dist/frame-sync.js +37 -0
- package/dist/frame-sync.js.map +1 -0
- package/dist/index.d.ts +17 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/matchers.d.ts +59 -0
- package/dist/matchers.d.ts.map +1 -0
- package/dist/matchers.js +117 -0
- package/dist/matchers.js.map +1 -0
- package/dist/pretty-widget.d.ts +24 -26
- package/dist/pretty-widget.d.ts.map +1 -1
- package/dist/pretty-widget.js +111 -117
- package/dist/pretty-widget.js.map +1 -1
- package/dist/queries.d.ts +190 -180
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +291 -320
- package/dist/queries.js.map +1 -1
- package/dist/register-test-hooks.d.ts +2 -0
- package/dist/register-test-hooks.d.ts.map +1 -0
- package/dist/register-test-hooks.js +16 -0
- package/dist/register-test-hooks.js.map +1 -0
- package/dist/render-hook.d.ts +15 -35
- package/dist/render-hook.d.ts.map +1 -1
- package/dist/render-hook.js +9 -45
- package/dist/render-hook.js.map +1 -1
- package/dist/render.d.ts +13 -42
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +138 -121
- package/dist/render.js.map +1 -1
- package/dist/role-helpers.d.ts +19 -53
- package/dist/role-helpers.d.ts.map +1 -1
- package/dist/role-helpers.js +48 -63
- package/dist/role-helpers.js.map +1 -1
- package/dist/screen.d.ts +7 -63
- package/dist/screen.d.ts.map +1 -1
- package/dist/screen.js +24 -110
- package/dist/screen.js.map +1 -1
- package/dist/screenshot.d.ts +21 -23
- package/dist/screenshot.d.ts.map +1 -1
- package/dist/screenshot.js +98 -50
- package/dist/screenshot.js.map +1 -1
- package/dist/suggestions.d.ts +27 -0
- package/dist/suggestions.d.ts.map +1 -0
- package/dist/suggestions.js +61 -0
- package/dist/suggestions.js.map +1 -0
- package/dist/traversal.d.ts +12 -10
- package/dist/traversal.d.ts.map +1 -1
- package/dist/traversal.js +36 -15
- package/dist/traversal.js.map +1 -1
- package/dist/types.d.ts +115 -169
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/user-event/adjustment.d.ts +10 -0
- package/dist/user-event/adjustment.d.ts.map +1 -0
- package/dist/user-event/adjustment.js +35 -0
- package/dist/user-event/adjustment.js.map +1 -0
- package/dist/user-event/click.d.ts +8 -0
- package/dist/user-event/click.d.ts.map +1 -0
- package/dist/user-event/click.js +73 -0
- package/dist/user-event/click.js.map +1 -0
- package/dist/user-event/controller.d.ts +8 -0
- package/dist/user-event/controller.d.ts.map +1 -0
- package/dist/user-event/controller.js +31 -0
- package/dist/user-event/controller.js.map +1 -0
- package/dist/user-event/dispatch.d.ts +7 -0
- package/dist/user-event/dispatch.d.ts.map +1 -0
- package/dist/user-event/dispatch.js +11 -0
- package/dist/user-event/dispatch.js.map +1 -0
- package/dist/user-event/event-wrapper.d.ts +4 -0
- package/dist/user-event/event-wrapper.d.ts.map +1 -0
- package/dist/user-event/event-wrapper.js +59 -0
- package/dist/user-event/event-wrapper.js.map +1 -0
- package/dist/user-event/gesture.d.ts +35 -0
- package/dist/user-event/gesture.d.ts.map +1 -0
- package/dist/user-event/gesture.js +138 -0
- package/dist/user-event/gesture.js.map +1 -0
- package/dist/user-event/index.d.ts +51 -0
- package/dist/user-event/index.d.ts.map +1 -0
- package/dist/user-event/index.js +42 -0
- package/dist/user-event/index.js.map +1 -0
- package/dist/user-event/keyboard.d.ts +10 -0
- package/dist/user-event/keyboard.d.ts.map +1 -0
- package/dist/user-event/keyboard.js +204 -0
- package/dist/user-event/keyboard.js.map +1 -0
- package/dist/user-event/pointer.d.ts +10 -0
- package/dist/user-event/pointer.d.ts.map +1 -0
- package/dist/user-event/pointer.js +30 -0
- package/dist/user-event/pointer.js.map +1 -0
- package/dist/user-event/selection.d.ts +5 -0
- package/dist/user-event/selection.d.ts.map +1 -0
- package/dist/user-event/selection.js +105 -0
- package/dist/user-event/selection.js.map +1 -0
- package/dist/user-event/state.d.ts +7 -0
- package/dist/user-event/state.d.ts.map +1 -0
- package/dist/user-event/state.js +3 -0
- package/dist/user-event/state.js.map +1 -0
- package/dist/user-event/text.d.ts +18 -0
- package/dist/user-event/text.d.ts.map +1 -0
- package/dist/user-event/text.js +113 -0
- package/dist/user-event/text.js.map +1 -0
- package/dist/wait-for.d.ts +16 -36
- package/dist/wait-for.d.ts.map +1 -1
- package/dist/wait-for.js +74 -70
- package/dist/wait-for.js.map +1 -1
- package/dist/widget-accessible-properties.d.ts +34 -0
- package/dist/widget-accessible-properties.d.ts.map +1 -0
- package/dist/widget-accessible-properties.js +260 -0
- package/dist/widget-accessible-properties.js.map +1 -0
- package/dist/within.d.ts +10 -26
- package/dist/within.d.ts.map +1 -1
- package/dist/within.js +16 -25
- package/dist/within.js.map +1 -1
- package/package.json +23 -12
- package/src/act.ts +77 -0
- package/src/bound-queries.ts +37 -0
- package/src/build-queries.ts +226 -0
- package/src/cleanup-registry.ts +27 -0
- package/src/config.ts +35 -62
- package/src/editable.ts +37 -0
- package/src/errors.ts +191 -0
- package/src/fire-event.ts +13 -38
- package/src/frame-sync.ts +51 -0
- package/src/index.ts +58 -15
- package/src/matchers.ts +251 -0
- package/src/pretty-widget.ts +163 -130
- package/src/queries.ts +485 -396
- package/src/register-test-hooks.ts +19 -0
- package/src/render-hook.tsx +38 -45
- package/src/render.tsx +192 -155
- package/src/role-helpers.ts +65 -72
- package/src/screen.ts +26 -114
- package/src/screenshot.ts +128 -56
- package/src/suggestions.ts +106 -0
- package/src/traversal.ts +56 -22
- package/src/types.ts +144 -172
- package/src/user-event/adjustment.ts +62 -0
- package/src/user-event/click.ts +99 -0
- package/src/user-event/controller.ts +58 -0
- package/src/user-event/dispatch.ts +25 -0
- package/src/user-event/event-wrapper.ts +80 -0
- package/src/user-event/gesture.ts +239 -0
- package/src/user-event/index.ts +81 -0
- package/src/user-event/keyboard.ts +290 -0
- package/src/user-event/pointer.ts +46 -0
- package/src/user-event/selection.ts +159 -0
- package/src/user-event/state.ts +8 -0
- package/src/user-event/text.ts +172 -0
- package/src/wait-for.ts +117 -78
- package/src/widget-accessible-properties.ts +388 -0
- package/src/within.ts +29 -27
- package/dist/bind-queries.d.ts +0 -14
- package/dist/bind-queries.d.ts.map +0 -1
- package/dist/bind-queries.js +0 -29
- package/dist/bind-queries.js.map +0 -1
- package/dist/error-builder.d.ts +0 -28
- package/dist/error-builder.d.ts.map +0 -1
- package/dist/error-builder.js +0 -81
- package/dist/error-builder.js.map +0 -1
- package/dist/timing.d.ts +0 -18
- package/dist/timing.d.ts.map +0 -1
- package/dist/timing.js +0 -18
- package/dist/timing.js.map +0 -1
- package/dist/user-event.d.ts +0 -138
- package/dist/user-event.d.ts.map +0 -1
- package/dist/user-event.js +0 -411
- package/dist/user-event.js.map +0 -1
- package/dist/widget-text.d.ts +0 -69
- package/dist/widget-text.d.ts.map +0 -1
- package/dist/widget-text.js +0 -177
- package/dist/widget-text.js.map +0 -1
- package/dist/widget.d.ts +0 -3
- package/dist/widget.d.ts.map +0 -1
- package/dist/widget.js +0 -13
- package/dist/widget.js.map +0 -1
- package/src/bind-queries.ts +0 -52
- package/src/error-builder.ts +0 -102
- package/src/timing.ts +0 -17
- package/src/user-event.ts +0 -492
- package/src/widget-text.ts +0 -202
- package/src/widget.ts +0 -15
package/dist/queries.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAkB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACH,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,GAChB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,eAAe,GAAG,CAAC,OAA0B,EAA8B,EAAE;IAC/E,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC,UAAU,CAAC;IAC9B,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC;IACnC,MAAM,kBAAkB,GAAG,OAAO,EAAE,kBAAkB,IAAI,IAAI,CAAC;IAE/D,OAAO,CAAC,IAAY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B,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,GAEzB,CAAC","sourcesContent":["import * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ByRoleOptions, ByRoleValue, Matcher, MatcherOptions, NormalizerFn, NormalizerOptions } from \"./types.js\";\nimport { buildQueries, type BuiltQueries, type QueryAllBy } from \"./build-queries.js\";\nimport { multipleFoundError, notFoundError } from \"./errors.js\";\nimport { type Container, findAll, traverse } from \"./traversal.js\";\nimport {\n getWidgetAccessibleName,\n getWidgetBusyState,\n getWidgetCheckedState,\n getWidgetDescription,\n getWidgetDisplayValue,\n getWidgetExpandedState,\n getWidgetLabelledByText,\n getWidgetLabelText,\n getWidgetLevel,\n getWidgetName,\n getWidgetOwnLabel,\n getWidgetPlaceholderText,\n getWidgetPressedState,\n getWidgetSelectedState,\n getWidgetValue,\n isInaccessible,\n} from \"./widget-accessible-properties.js\";\n\ntype QueryFamilyReturns = {\n queryBy: Gtk.Widget | null;\n queryAllBy: Gtk.Widget[];\n getBy: Gtk.Widget;\n getAllBy: Gtk.Widget[];\n findBy: Promise<Gtk.Widget>;\n findAllBy: Promise<Gtk.Widget[]>;\n};\n\ntype NamedFamily<Suffix extends string, Args extends unknown[]> = {\n [K in keyof QueryFamilyReturns as `${K & string}${Suffix}`]: (\n container: Container,\n ...args: Args\n ) => QueryFamilyReturns[K];\n};\n\ntype BuiltinQueries = NamedFamily<\"Role\", [role: Gtk.AccessibleRole, options?: ByRoleOptions]> &\n NamedFamily<\"LabelText\", [text: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"Text\", [text: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"Name\", [name: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"PlaceholderText\", [text: Matcher, options?: MatcherOptions]> &\n NamedFamily<\"DisplayValue\", [value: Matcher, options?: MatcherOptions]>;\n\nconst roleQueries = nameQueryFamily(\n \"Role\",\n queryAllByRole,\n buildQueries<[role: Gtk.AccessibleRole, options?: ByRoleOptions]>(\n \"Role\",\n queryAllByRole,\n (container, matches, role, options) =>\n multipleFoundError(container, { queryType: \"role\", role, options }, matches),\n (container, role, options) => notFoundError(container, { queryType: \"role\", role, options }),\n ),\n);\n\nconst labelTextQueries = nameQueryFamily(\n \"LabelText\",\n queryAllByLabelText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"LabelText\",\n queryAllByLabelText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"labelText\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"labelText\", text }),\n ),\n);\n\nconst textQueries = nameQueryFamily(\n \"Text\",\n queryAllByText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"Text\",\n queryAllByText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"text\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"text\", text }),\n ),\n);\n\nconst nameQueries = nameQueryFamily(\n \"Name\",\n queryAllByName,\n buildQueries<[name: Matcher, options?: MatcherOptions]>(\n \"Name\",\n queryAllByName,\n (container, matches, name) => multipleFoundError(container, { queryType: \"name\", name }, matches),\n (container, name) => notFoundError(container, { queryType: \"name\", name }),\n ),\n);\n\nconst placeholderTextQueries = nameQueryFamily(\n \"PlaceholderText\",\n queryAllByPlaceholderText,\n buildQueries<[text: Matcher, options?: MatcherOptions]>(\n \"PlaceholderText\",\n queryAllByPlaceholderText,\n (container, matches, text) => multipleFoundError(container, { queryType: \"placeholderText\", text }, matches),\n (container, text) => notFoundError(container, { queryType: \"placeholderText\", text }),\n ),\n);\n\nconst displayValueQueries = nameQueryFamily(\n \"DisplayValue\",\n queryAllByDisplayValue,\n buildQueries<[value: Matcher, options?: MatcherOptions]>(\n \"DisplayValue\",\n queryAllByDisplayValue,\n (container, matches, value) => multipleFoundError(container, { queryType: \"displayValue\", value }, matches),\n (container, value) => notFoundError(container, { queryType: \"displayValue\", value }),\n ),\n);\n\nconst builtinQueries: BuiltinQueries = {\n ...roleQueries,\n ...labelTextQueries,\n ...textQueries,\n ...nameQueries,\n ...placeholderTextQueries,\n ...displayValueQueries,\n};\n\n/**\n * Returns the single widget with a matching accessible role and options, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByRole: BuiltinQueries[\"queryByRole\"] = roleQueries.queryByRole;\n/** Returns every widget with a matching accessible role and options. Throws when none match. */\nconst getAllByRole: BuiltinQueries[\"getAllByRole\"] = roleQueries.getAllByRole;\n/**\n * Returns the single widget with a matching accessible role and options.\n * Throws when none or more than one matches.\n */\nconst getByRole: BuiltinQueries[\"getByRole\"] = roleQueries.getByRole;\n/**\n * Waits for and returns every widget with a matching accessible role and options, retrying until at\n * least one appears or the timeout elapses.\n */\nconst findAllByRole: BuiltinQueries[\"findAllByRole\"] = roleQueries.findAllByRole;\n/**\n * Waits for and returns the single widget with a matching accessible role and options, retrying\n * until it appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByRole: BuiltinQueries[\"findByRole\"] = roleQueries.findByRole;\n/**\n * Returns the single widget with matching associated label text, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByLabelText: BuiltinQueries[\"queryByLabelText\"] = labelTextQueries.queryByLabelText;\n/** Returns every widget with matching associated label text. Throws when none match. */\nconst getAllByLabelText: BuiltinQueries[\"getAllByLabelText\"] = labelTextQueries.getAllByLabelText;\n/** Returns the single widget with matching associated label text. Throws when none or more than one matches. */\nconst getByLabelText: BuiltinQueries[\"getByLabelText\"] = labelTextQueries.getByLabelText;\n/**\n * Waits for and returns every widget with matching associated label text, retrying until at least\n * one appears or the timeout elapses.\n */\nconst findAllByLabelText: BuiltinQueries[\"findAllByLabelText\"] = labelTextQueries.findAllByLabelText;\n/**\n * Waits for and returns the single widget with matching associated label text, retrying until it\n * appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByLabelText: BuiltinQueries[\"findByLabelText\"] = labelTextQueries.findByLabelText;\n/**\n * Returns the single widget with matching rendered text content, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByText: BuiltinQueries[\"queryByText\"] = textQueries.queryByText;\n/** Returns every widget with matching rendered text content. Throws when none match. */\nconst getAllByText: BuiltinQueries[\"getAllByText\"] = textQueries.getAllByText;\n/** Returns the single widget with matching rendered text content. Throws when none or more than one matches. */\nconst getByText: BuiltinQueries[\"getByText\"] = textQueries.getByText;\n/**\n * Waits for and returns every widget with matching rendered text content, retrying until at least\n * one appears or the timeout elapses.\n */\nconst findAllByText: BuiltinQueries[\"findAllByText\"] = textQueries.findAllByText;\n/**\n * Waits for and returns the single widget with matching rendered text content, retrying until it\n * appears or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByText: BuiltinQueries[\"findByText\"] = textQueries.findByText;\n/**\n * Returns the single widget with a matching widget name, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByName: BuiltinQueries[\"queryByName\"] = nameQueries.queryByName;\n/** Returns every widget with a matching widget name. Throws when none match. */\nconst getAllByName: BuiltinQueries[\"getAllByName\"] = nameQueries.getAllByName;\n/** Returns the single widget with a matching widget name. Throws when none or more than one matches. */\nconst getByName: BuiltinQueries[\"getByName\"] = nameQueries.getByName;\n/**\n * Waits for and returns every widget with a matching widget name, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByName: BuiltinQueries[\"findAllByName\"] = nameQueries.findAllByName;\n/**\n * Waits for and returns the single widget with a matching widget name, retrying until it appears or\n * the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByName: BuiltinQueries[\"findByName\"] = nameQueries.findByName;\n\n/**\n * Returns the single widget with matching placeholder text, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByPlaceholderText: BuiltinQueries[\"queryByPlaceholderText\"] =\n placeholderTextQueries.queryByPlaceholderText;\n\n/** Returns every widget with matching placeholder text. Throws when none match. */\nconst getAllByPlaceholderText: BuiltinQueries[\"getAllByPlaceholderText\"] =\n placeholderTextQueries.getAllByPlaceholderText;\n\n/** Returns the single widget with matching placeholder text. Throws when none or more than one matches. */\nconst getByPlaceholderText: BuiltinQueries[\"getByPlaceholderText\"] = placeholderTextQueries.getByPlaceholderText;\n\n/**\n * Waits for and returns every widget with matching placeholder text, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByPlaceholderText: BuiltinQueries[\"findAllByPlaceholderText\"] =\n placeholderTextQueries.findAllByPlaceholderText;\n\n/**\n * Waits for and returns the single widget with matching placeholder text, retrying until it appears\n * or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByPlaceholderText: BuiltinQueries[\"findByPlaceholderText\"] =\n placeholderTextQueries.findByPlaceholderText;\n\n/**\n * Returns the single widget with a matching display value, or null when none match.\n * Throws when more than one matches.\n */\nconst queryByDisplayValue: BuiltinQueries[\"queryByDisplayValue\"] = displayValueQueries.queryByDisplayValue;\n/** Returns every widget with a matching display value. Throws when none match. */\nconst getAllByDisplayValue: BuiltinQueries[\"getAllByDisplayValue\"] = displayValueQueries.getAllByDisplayValue;\n/** Returns the single widget with a matching display value. Throws when none or more than one matches. */\nconst getByDisplayValue: BuiltinQueries[\"getByDisplayValue\"] = displayValueQueries.getByDisplayValue;\n/**\n * Waits for and returns every widget with a matching display value, retrying until at least one\n * appears or the timeout elapses.\n */\nconst findAllByDisplayValue: BuiltinQueries[\"findAllByDisplayValue\"] = displayValueQueries.findAllByDisplayValue;\n/**\n * Waits for and returns the single widget with a matching display value, retrying until it appears\n * or the timeout elapses. Rejects when none or more than one matches.\n */\nconst findByDisplayValue: BuiltinQueries[\"findByDisplayValue\"] = displayValueQueries.findByDisplayValue;\n\n/**\n * Builds the default text normalizer, which optionally trims surrounding whitespace and collapses\n * runs of whitespace into single spaces.\n * @param options Toggles for trimming and whitespace collapsing.\n * @returns A function that normalizes a string for comparison against a matcher.\n */\nconst getDefaultNormalizer = ({\n trim = true,\n collapseWhitespace = true,\n}: NormalizerOptions = {}): NormalizerFn => {\n return (text: string): string => {\n let result = text;\n\n if (trim) {\n result = result.trim();\n }\n\n if (collapseWhitespace) {\n result = result.replaceAll(/\\s+/g, \" \");\n }\n\n return result;\n };\n};\n\nconst buildNormalizer = (options?: MatcherOptions): NormalizerFn => {\n const { normalizer, trim, collapseWhitespace } = options ?? {};\n\n if (!normalizer) {\n return getDefaultNormalizer({ trim, collapseWhitespace });\n }\n\n if (trim !== undefined || collapseWhitespace !== undefined) {\n throw new Error(\n \"trim and collapseWhitespace are not supported with a normalizer. \" +\n \"If you want to use the default trim and collapseWhitespace logic in your normalizer, \" +\n \"use \\\"getDefaultNormalizer({ trim, collapseWhitespace })\\\" and compose that into your normalizer\",\n );\n }\n\n return normalizer;\n};\n\nconst normalizeText = (text: string, options?: MatcherOptions): string => {\n const normalizer = buildNormalizer(options);\n\n return normalizer(text);\n};\n\nconst isTextMatch = (\n actual: string | null,\n expected: Matcher,\n widget: Gtk.Widget,\n options?: MatcherOptions,\n): boolean => {\n if (actual === null) {\n return false;\n }\n\n const normalizedActual = normalizeText(actual, options);\n\n if (typeof expected === \"function\") {\n return expected(normalizedActual, widget);\n }\n\n if (expected instanceof RegExp) {\n expected.lastIndex = 0;\n\n return expected.test(normalizedActual);\n }\n\n const normalizedExpected = normalizeText(String(expected), options);\n const isExact = options?.exact ?? true;\n\n return isExact\n ? normalizedActual === normalizedExpected\n : normalizedActual.toLowerCase().includes(normalizedExpected.toLowerCase());\n};\n\nconst hasMatchingAccessibleName = (widget: Gtk.Widget, options: ByRoleOptions): boolean => {\n if (options.name === undefined) {\n return true;\n }\n\n const text = getWidgetAccessibleName(widget);\n\n return isTextMatch(text, options.name, widget, options);\n};\n\nconst isNumericValueMatch = (expected: number | undefined, actual: number | null): boolean =>\n expected === undefined || actual === expected;\n\nconst hasMatchingAccessibleValue = (widget: Gtk.Widget, value: ByRoleValue, options: ByRoleOptions): boolean => {\n const actual = getWidgetValue(widget);\n\n const numericChecks: [number | undefined, number | null][] = [\n [value.now, actual.now],\n [value.min, actual.min],\n [value.max, actual.max],\n ];\n\n for (const [expected, current] of numericChecks) {\n if (!isNumericValueMatch(expected, current)) {\n return false;\n }\n }\n\n return value.text === undefined || isTextMatch(actual.text, value.text, widget, options);\n};\n\nconst hasMatchingBooleanStates = (widget: Gtk.Widget, options: ByRoleOptions): boolean => {\n const stateChecks: [boolean | undefined, () => boolean | null][] = [\n [options.checked, () => getWidgetCheckedState(widget)],\n [options.pressed, () => getWidgetPressedState(widget)],\n [options.expanded, () => getWidgetExpandedState(widget)],\n [options.selected, () => getWidgetSelectedState(widget)],\n [options.busy, () => getWidgetBusyState(widget) ?? false],\n ];\n\n for (const [expected, getActual] of stateChecks) {\n if (expected !== undefined && getActual() !== expected) {\n return false;\n }\n }\n\n return true;\n};\n\nconst hasMatchingLevelState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.level === undefined || getWidgetLevel(widget) === options.level;\n\nconst hasMatchingDescriptionState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.description === undefined ||\n isTextMatch(getWidgetDescription(widget), options.description, widget, options);\n\nconst hasMatchingValueState = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n options.value === undefined || hasMatchingAccessibleValue(widget, options.value, options);\n\nconst hasMatchingAccessibleStates = (widget: Gtk.Widget, options: ByRoleOptions): boolean =>\n hasMatchingBooleanStates(widget, options) &&\n hasMatchingLevelState(widget, options) &&\n hasMatchingDescriptionState(widget, options) &&\n hasMatchingValueState(widget, options);\n\nconst hasMatchingByRoleOptions = (widget: Gtk.Widget, options?: ByRoleOptions): boolean => {\n if (!options) {\n return true;\n }\n\n return hasMatchingAccessibleName(widget, options) && hasMatchingAccessibleStates(widget, options);\n};\n\nfunction nameQueryFamily<Suffix extends string, Args extends unknown[]>(\n suffix: Suffix,\n queryAllBy: QueryAllBy<Args>,\n built: BuiltQueries<Args>,\n): NamedFamily<Suffix, Args> {\n const family = {\n [`queryBy${suffix}`]: built.queryBy,\n [`queryAllBy${suffix}`]: queryAllBy,\n [`getBy${suffix}`]: built.getBy,\n [`getAllBy${suffix}`]: built.getAllBy,\n [`findBy${suffix}`]: built.findBy,\n [`findAllBy${suffix}`]: built.findAllBy,\n };\n\n return family as NamedFamily<Suffix, Args>;\n}\n\n/**\n * Finds every widget under the container whose accessible role matches `role` and that satisfies the given options.\n * Widgets excluded from the accessibility tree are skipped unless `options.hidden` is set.\n * @param container Widget subtree to search.\n * @param role Accessible role to match.\n * @param options Additional accessible name, state, and value constraints.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByRole(\n container: Container,\n role: Gtk.AccessibleRole,\n options?: ByRoleOptions,\n): Gtk.Widget[] {\n return findAll(container, (widget) => {\n if (widget.getAccessibleRole() !== role) {\n return false;\n }\n\n if (!options?.hidden && isInaccessible(widget)) {\n return false;\n }\n\n return hasMatchingByRoleOptions(widget, options);\n });\n}\n\nconst collectMnemonicMatch = (\n widget: Gtk.Widget,\n text: Matcher,\n options: MatcherOptions | undefined,\n): Gtk.Widget | null => {\n if (!(widget instanceof Gtk.Label)) {\n return null;\n }\n\n const labelText = widget.getLabel();\n\n if (!labelText || !isTextMatch(labelText, text, widget, options)) {\n return null;\n }\n\n return widget.getMnemonicWidget();\n};\n\nconst collectLabelMatches = (\n results: Set<Gtk.Widget>,\n widget: Gtk.Widget,\n text: Matcher,\n options: MatcherOptions | undefined,\n): void => {\n const mnemonicTarget = collectMnemonicMatch(widget, text, options);\n\n if (mnemonicTarget) {\n results.add(mnemonicTarget);\n }\n\n const ownLabel = getWidgetOwnLabel(widget);\n\n if (ownLabel !== null && isTextMatch(ownLabel, text, widget, options)) {\n results.add(widget);\n }\n\n const labelledByText = getWidgetLabelledByText(widget);\n\n if (labelledByText !== null && isTextMatch(labelledByText, text, widget, options)) {\n results.add(widget);\n }\n};\n\n/**\n * Finds every widget associated with a label whose text matches: a Gtk.Label mnemonic target, the\n * widget's own accessible label, or its labelled-by relation.\n * @param container Widget subtree to search.\n * @param text Matcher for the label text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByLabelText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n const results: Set<Gtk.Widget> = new Set();\n\n for (const widget of traverse(container)) {\n collectLabelMatches(results, widget, text, options);\n }\n\n return [...results];\n}\n\n/**\n * Finds every widget whose rendered text content matches.\n * @param container Widget subtree to search.\n * @param text Matcher for the widget text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetLabelText(widget), text, widget, options));\n}\n\n/**\n * Finds every widget whose widget name matches.\n * @param container Widget subtree to search.\n * @param name Matcher for the widget name.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByName(container: Container, name: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetName(widget), name, widget, options));\n}\n\n/**\n * Finds every widget whose placeholder text matches.\n * @param container Widget subtree to search.\n * @param text Matcher for the placeholder text.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByPlaceholderText(\n container: Container,\n text: Matcher,\n options?: MatcherOptions,\n): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetPlaceholderText(widget), text, widget, options));\n}\n\n/**\n * Finds every widget whose current display value matches.\n * @param container Widget subtree to search.\n * @param value Matcher for the display value.\n * @param options Text matching options.\n * @returns Every matching widget, or an empty array when none match.\n */\nfunction queryAllByDisplayValue(container: Container, value: Matcher, options?: MatcherOptions): Gtk.Widget[] {\n return findAll(container, (widget) => isTextMatch(getWidgetDisplayValue(widget), value, widget, options));\n}\n\nexport {\n builtinQueries,\n queryByRole,\n getAllByRole,\n getByRole,\n findAllByRole,\n findByRole,\n queryByLabelText,\n getAllByLabelText,\n getByLabelText,\n findAllByLabelText,\n findByLabelText,\n queryByText,\n getAllByText,\n getByText,\n findAllByText,\n findByText,\n queryByName,\n getAllByName,\n getByName,\n findAllByName,\n findByName,\n queryByPlaceholderText,\n getAllByPlaceholderText,\n getByPlaceholderText,\n findAllByPlaceholderText,\n findByPlaceholderText,\n queryByDisplayValue,\n getAllByDisplayValue,\n getByDisplayValue,\n findAllByDisplayValue,\n findByDisplayValue,\n getDefaultNormalizer,\n queryAllByRole,\n queryAllByLabelText,\n queryAllByText,\n queryAllByName,\n queryAllByPlaceholderText,\n queryAllByDisplayValue,\n type BuiltinQueries,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-test-hooks.d.ts","sourceRoot":"","sources":["../src/register-test-hooks.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { quit } from "@gtkx/runtime";
|
|
2
|
+
import { registerMatchers } from "./matchers.js";
|
|
3
|
+
import { cleanup } from "./render.js";
|
|
4
|
+
const callRunnerHook = (name, callback) => {
|
|
5
|
+
const hook = Reflect.get(globalThis, name);
|
|
6
|
+
if (typeof hook === "function") {
|
|
7
|
+
hook(callback);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const registerTestRuntimeHooks = () => {
|
|
11
|
+
callRunnerHook("afterEach", cleanup);
|
|
12
|
+
callRunnerHook("afterAll", quit);
|
|
13
|
+
registerMatchers();
|
|
14
|
+
};
|
|
15
|
+
registerTestRuntimeHooks();
|
|
16
|
+
//# sourceMappingURL=register-test-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-test-hooks.js","sourceRoot":"","sources":["../src/register-test-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,cAAc,GAAG,CAAC,IAA8B,EAAE,QAAuB,EAAQ,EAAE;IACrF,MAAM,IAAI,GAAY,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAEpD,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC5B,IAA0C,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,GAAS,EAAE;IACxC,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACrC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACjC,gBAAgB,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,wBAAwB,EAAE,CAAC","sourcesContent":["import { quit } from \"@gtkx/runtime\";\nimport { registerMatchers } from \"./matchers.js\";\nimport { cleanup } from \"./render.js\";\n\nconst callRunnerHook = (name: \"afterEach\" | \"afterAll\", callback: () => unknown): void => {\n const hook: unknown = Reflect.get(globalThis, name);\n\n if (typeof hook === \"function\") {\n (hook as (callback: () => unknown) => void)(callback);\n }\n};\n\nconst registerTestRuntimeHooks = (): void => {\n callRunnerHook(\"afterEach\", cleanup);\n callRunnerHook(\"afterAll\", quit);\n registerMatchers();\n};\n\nregisterTestRuntimeHooks();\n"]}
|
package/dist/render-hook.d.ts
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
1
1
|
import type { RenderHookOptions, RenderHookResult } from "./types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Renders a
|
|
3
|
+
* Renders a test component that calls the given hook, exposing its latest
|
|
4
|
+
* return value along with rerender and unmount controls.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* ```tsx
|
|
14
|
-
* import { renderHook } from "@gtkx/testing";
|
|
15
|
-
* import { useState } from "react";
|
|
16
|
-
*
|
|
17
|
-
* test("useState hook", async () => {
|
|
18
|
-
* const { result } = await renderHook(() => useState(0));
|
|
19
|
-
* expect(result.current[0]).toBe(0);
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```tsx
|
|
25
|
-
* import { renderHook } from "@gtkx/testing";
|
|
26
|
-
*
|
|
27
|
-
* test("hook with props", async () => {
|
|
28
|
-
* const { result, rerender } = await renderHook(
|
|
29
|
-
* ({ multiplier }) => useMultiplier(multiplier),
|
|
30
|
-
* { initialProps: { multiplier: 2 } }
|
|
31
|
-
* );
|
|
32
|
-
*
|
|
33
|
-
* expect(result.current).toBe(2);
|
|
6
|
+
* @param callback The hook to run, invoked with the current props.
|
|
7
|
+
* @param options Optional initial props and wrapper component.
|
|
8
|
+
* @returns A result whose `result.current` holds the hook's latest value.
|
|
9
|
+
*/
|
|
10
|
+
declare function renderHook<Result>(callback: () => Result, options?: RenderHookOptions<undefined>): Promise<RenderHookResult<Result, undefined>>;
|
|
11
|
+
/**
|
|
12
|
+
* Renders a test component that calls the given hook with props, exposing its
|
|
13
|
+
* latest return value along with rerender and unmount controls.
|
|
34
14
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* ```
|
|
15
|
+
* @param callback The hook to run, invoked with the current props.
|
|
16
|
+
* @param options Initial props and optional wrapper component.
|
|
17
|
+
* @returns A result whose `result.current` holds the hook's latest value.
|
|
39
18
|
*/
|
|
40
|
-
|
|
19
|
+
declare function renderHook<Result, Props>(callback: (props: Props) => Result, options: RenderHookOptions<Props>): Promise<RenderHookResult<Result, Props>>;
|
|
20
|
+
export { renderHook };
|
|
41
21
|
//# sourceMappingURL=render-hook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-hook.d.ts","sourceRoot":"","sources":["../src/render-hook.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render-hook.d.ts","sourceRoot":"","sources":["../src/render-hook.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGtE;;;;;;;GAOG;AACH,iBAAS,UAAU,CAAC,MAAM,EACtB,QAAQ,EAAE,MAAM,MAAM,EACtB,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,GACvC,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,EAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,EAClC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAClC,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAmC5C,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/render-hook.js
CHANGED
|
@@ -1,55 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import * as Gtk from "@gtkx/gi/gtk";
|
|
3
3
|
import { render } from "./render.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* Creates a test component that executes the hook and provides utilities
|
|
8
|
-
* for accessing the result, re-rendering with new props, and cleanup.
|
|
9
|
-
*
|
|
10
|
-
* @param callback - Function that calls the hook and returns its result
|
|
11
|
-
* @param options - Render options including initialProps and wrapper
|
|
12
|
-
* @returns A promise resolving to the hook result and utilities
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* import { renderHook } from "@gtkx/testing";
|
|
17
|
-
* import { useState } from "react";
|
|
18
|
-
*
|
|
19
|
-
* test("useState hook", async () => {
|
|
20
|
-
* const { result } = await renderHook(() => useState(0));
|
|
21
|
-
* expect(result.current[0]).toBe(0);
|
|
22
|
-
* });
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```tsx
|
|
27
|
-
* import { renderHook } from "@gtkx/testing";
|
|
28
|
-
*
|
|
29
|
-
* test("hook with props", async () => {
|
|
30
|
-
* const { result, rerender } = await renderHook(
|
|
31
|
-
* ({ multiplier }) => useMultiplier(multiplier),
|
|
32
|
-
* { initialProps: { multiplier: 2 } }
|
|
33
|
-
* );
|
|
34
|
-
*
|
|
35
|
-
* expect(result.current).toBe(2);
|
|
36
|
-
*
|
|
37
|
-
* await rerender({ multiplier: 3 });
|
|
38
|
-
* expect(result.current).toBe(3);
|
|
39
|
-
* });
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export const renderHook = async (callback, options) => {
|
|
4
|
+
async function renderHook(callback, options) {
|
|
5
|
+
const initialProps = options?.initialProps;
|
|
43
6
|
const resultRef = { current: undefined };
|
|
44
|
-
let currentProps =
|
|
7
|
+
let currentProps = initialProps;
|
|
45
8
|
const TestComponent = ({ props }) => {
|
|
46
9
|
const result = callback(props);
|
|
47
|
-
|
|
48
|
-
ref.current.current = result;
|
|
10
|
+
resultRef.current = result;
|
|
49
11
|
return null;
|
|
50
12
|
};
|
|
51
13
|
const renderResult = await render(_jsx(TestComponent, { props: currentProps }), {
|
|
52
|
-
|
|
14
|
+
container: new Gtk.Box(),
|
|
15
|
+
wrapper: options?.wrapper,
|
|
53
16
|
});
|
|
54
17
|
return {
|
|
55
18
|
result: resultRef,
|
|
@@ -61,5 +24,6 @@ export const renderHook = async (callback, options) => {
|
|
|
61
24
|
},
|
|
62
25
|
unmount: renderResult.unmount,
|
|
63
26
|
};
|
|
64
|
-
}
|
|
27
|
+
}
|
|
28
|
+
export { renderHook };
|
|
65
29
|
//# sourceMappingURL=render-hook.js.map
|
package/dist/render-hook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-hook.js","sourceRoot":"","sources":["../src/render-hook.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"render-hook.js","sourceRoot":"","sources":["../src/render-hook.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA4BrC,KAAK,UAAU,UAAU,CACrB,QAAkC,EAClC,OAAkC;IAElC,MAAM,YAAY,GAAI,OAAgD,EAAE,YAAqB,CAAC;IAC9F,MAAM,SAAS,GAAoC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAC1E,IAAI,YAAY,GAAU,YAAY,CAAC;IAEvC,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAoB,EAAQ,EAAE;QACxD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/B,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;QAE3B,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,GAAI,EAAE;QACtE,SAAS,EAAE,IAAI,GAAG,CAAC,GAAG,EAAE;QACxB,OAAO,EAAE,OAAO,EAAE,OAAO;KAC5B,CAAC,CAAC;IAEH,OAAO;QACH,MAAM,EAAE,SAAgC;QACxC,QAAQ,EAAE,KAAK,EAAE,QAAgB,EAAE,EAAE;YACjC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACzB,YAAY,GAAG,QAAQ,CAAC;YAC5B,CAAC;YAED,MAAM,YAAY,CAAC,QAAQ,CAAC,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,GAAI,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,EAAE,YAAY,CAAC,OAAO;KAChC,CAAC;AACN,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import * as Gtk from \"@gtkx/gi/gtk\";\nimport type { RenderHookOptions, RenderHookResult } from \"./types.js\";\nimport { render } from \"./render.js\";\n\n/**\n * Renders a test component that calls the given hook, exposing its latest\n * return value along with rerender and unmount controls.\n *\n * @param callback The hook to run, invoked with the current props.\n * @param options Optional initial props and wrapper component.\n * @returns A result whose `result.current` holds the hook's latest value.\n */\nfunction renderHook<Result>(\n callback: () => Result,\n options?: RenderHookOptions<undefined>,\n): Promise<RenderHookResult<Result, undefined>>;\n\n/**\n * Renders a test component that calls the given hook with props, exposing its\n * latest return value along with rerender and unmount controls.\n *\n * @param callback The hook to run, invoked with the current props.\n * @param options Initial props and optional wrapper component.\n * @returns A result whose `result.current` holds the hook's latest value.\n */\nfunction renderHook<Result, Props>(\n callback: (props: Props) => Result,\n options: RenderHookOptions<Props>,\n): Promise<RenderHookResult<Result, Props>>;\n\nasync function renderHook<Result, Props>(\n callback: (props: Props) => Result,\n options?: RenderHookOptions<Props>,\n): Promise<RenderHookResult<Result, Props>> {\n const initialProps = (options as { initialProps?: Props } | undefined)?.initialProps as Props;\n const resultRef: { current: Result | undefined } = { current: undefined };\n let currentProps: Props = initialProps;\n\n const TestComponent = ({ props }: { props: Props }): null => {\n const result = callback(props);\n resultRef.current = result;\n\n return null;\n };\n\n const renderResult = await render(<TestComponent props={currentProps} />, {\n container: new Gtk.Box(),\n wrapper: options?.wrapper,\n });\n\n return {\n result: resultRef as { current: Result },\n rerender: async (newProps?: Props) => {\n if (newProps !== undefined) {\n currentProps = newProps;\n }\n\n await renderResult.rerender(<TestComponent props={currentProps} />);\n },\n unmount: renderResult.unmount,\n };\n}\n\nexport { renderHook };\n"]}
|
package/dist/render.d.ts
CHANGED
|
@@ -1,49 +1,20 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { RenderResult } from "./bound-queries.js";
|
|
3
|
+
import type { QueryMap, RenderOptions } from "./types.js";
|
|
3
4
|
/**
|
|
4
|
-
* Renders a React element
|
|
5
|
+
* Renders a React element into a GTK4 widget tree and returns queries
|
|
6
|
+
* scoped to it along with controls for rerendering and unmounting. When no
|
|
7
|
+
* container is supplied, a harness window is created and presented.
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @param element - The React element to render
|
|
10
|
-
* @param options - Render options including wrapper configuration
|
|
11
|
-
* @returns A promise resolving to query methods and utilities
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* import { render, screen } from "@gtkx/testing";
|
|
16
|
-
*
|
|
17
|
-
* test("button click", async () => {
|
|
18
|
-
* await render(<MyButton />);
|
|
19
|
-
* const button = await screen.findByRole(Gtk.AccessibleRole.BUTTON);
|
|
20
|
-
* await userEvent.click(button);
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @see {@link cleanup} for cleaning up after tests
|
|
25
|
-
* @see {@link screen} for global query access
|
|
9
|
+
* @param element The React element to render.
|
|
10
|
+
* @param options Optional container, wrapper, custom queries, and other render settings.
|
|
11
|
+
* @returns A render result with bound queries, debug helpers, and lifecycle controls.
|
|
26
12
|
*/
|
|
27
|
-
|
|
13
|
+
declare const render: <Q extends QueryMap = Record<never, never>>(element: ReactNode, options?: RenderOptions<Q>) => Promise<RenderResult<Q>>;
|
|
28
14
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* Unmounts all rendered components and resets the testing environment.
|
|
32
|
-
* Call this in `afterEach` to ensure tests don't affect each other.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```tsx
|
|
36
|
-
* import { render, cleanup } from "@gtkx/testing";
|
|
37
|
-
*
|
|
38
|
-
* afterEach(async () => {
|
|
39
|
-
* await cleanup();
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* test("my test", async () => {
|
|
43
|
-
* await render(<MyComponent />);
|
|
44
|
-
* // ...
|
|
45
|
-
* });
|
|
46
|
-
* ```
|
|
15
|
+
* Unmounts every active render and runs all registered cleanup callbacks,
|
|
16
|
+
* resetting the screen and clipboard. Called automatically after each test.
|
|
47
17
|
*/
|
|
48
|
-
|
|
18
|
+
declare const cleanup: () => Promise<void>;
|
|
19
|
+
export { render, cleanup };
|
|
49
20
|
//# sourceMappingURL=render.d.ts.map
|
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAkB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAqC,MAAM,YAAY,CAAC;AA+I7F;;;;;;;;GAQG;AACH,QAAA,MAAM,MAAM,GAAU,CAAC,SAAS,QAAQ,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC3D,SAAS,SAAS,EAClB,UAAU,aAAa,CAAC,CAAC,CAAC,KAC3B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAqDzB,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,OAAO,QAAa,OAAO,CAAC,IAAI,CAErC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
|