@gtkx/testing 2.0.0-beta.7 → 2.0.0-beta.9

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.
@@ -1,4 +1,4 @@
1
- import type { SyncExpectationResult } from "@vitest/expect";
1
+ import type { SyncMatcherResult } from "vitest";
2
2
  import * as Gtk from "@gtkx/gi/gtk";
3
3
  import type { ByRoleOptions, Matcher, MatcherOptions } from "./types.js";
4
4
  import { type AccessibleAttributeValue } from "./accessible-native.js";
@@ -15,7 +15,7 @@ type TextContentOptions = {
15
15
  /** The expected value for a style class: an exact class name or a regular expression. */
16
16
  type ClassExpectation = string | RegExp;
17
17
  /** The outcome of a matcher: whether it passed, and the failure text built on demand. */
18
- type MatcherResult = Pick<SyncExpectationResult, "message" | "pass">;
18
+ type MatcherResult = Pick<SyncMatcherResult, "message" | "pass">;
19
19
  /** The matcher state bound as `this`, supplying the test runner's deep equality check. */
20
20
  type MatcherContext = {
21
21
  /** Compares a received value against an expected one, resolving asymmetric matchers. */
@@ -146,59 +146,55 @@ type MatcherImplementations = {
146
146
  declare const matchers: MatcherImplementations;
147
147
  /** Registers the widget matchers on the global `expect`, when one is available. Safe to call more than once. */
148
148
  declare const registerMatchers: () => void;
149
- declare module "@vitest/expect" {
150
- interface WidgetMatchers {
151
- toHaveDisplayValue(expected?: TextExpectation): void;
152
- toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): void;
153
- toHaveAccessibleName(expected?: TextExpectation): void;
154
- toHaveAccessibleDescription(expected?: TextExpectation): void;
155
- toHaveAccessibleErrorMessage(expected?: TextExpectation): void;
156
- toHaveSelection(expected?: TextExpectation): void;
157
- toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): void;
158
- toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): void;
159
- toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): void;
160
- toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): void;
161
- toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): void;
162
- toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): void;
163
- toHaveAccessibleProperty(property: Gtk.AccessibleProperty.AUTOCOMPLETE, expected?: Gtk.AccessibleAutocomplete): void;
164
- toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): void;
165
- toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): void;
166
- toBeChecked(): void;
167
- toBePartiallyChecked(): void;
168
- toBePressed(): void;
169
- toBePartiallyPressed(): void;
170
- toBeDisabled(): void;
171
- toBeEnabled(): void;
172
- toBeVisible(): void;
173
- toBeRooted(): void;
174
- toBeEmptyWidget(): void;
175
- toBeInvalid(): void;
176
- toBeValid(): void;
177
- toBeRequired(): void;
178
- toHaveFocus(): void;
179
- toHaveValue(expected?: number | string): void;
180
- toHaveRole(expected: Gtk.AccessibleRole): void;
181
- toContainElement(descendant: Gtk.Accessible | null): void;
182
- toAppearBefore(other: Gtk.Accessible): void;
183
- toAppearAfter(other: Gtk.Accessible): void;
184
- toContainAnyByRole(...args: RoleQueryArgs): void;
185
- toContainOneByRole(...args: RoleQueryArgs): void;
186
- toContainAnyByText(...args: TextQueryArgs): void;
187
- toContainOneByText(...args: TextQueryArgs): void;
188
- toContainAnyByLabelText(...args: TextQueryArgs): void;
189
- toContainOneByLabelText(...args: TextQueryArgs): void;
190
- toContainAnyByPlaceholderText(...args: TextQueryArgs): void;
191
- toContainOneByPlaceholderText(...args: TextQueryArgs): void;
192
- toContainAnyByDisplayValue(...args: TextQueryArgs): void;
193
- toContainOneByDisplayValue(...args: TextQueryArgs): void;
149
+ declare module "vitest" {
150
+ interface Matchers<R extends void | Promise<void> = void | Promise<void>, T = unknown> {
151
+ toHaveDisplayValue(expected?: TextExpectation): R;
152
+ toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): R;
153
+ toHaveAccessibleName(expected?: TextExpectation): R;
154
+ toHaveAccessibleDescription(expected?: TextExpectation): R;
155
+ toHaveAccessibleErrorMessage(expected?: TextExpectation): R;
156
+ toHaveSelection(expected?: TextExpectation): R;
157
+ toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): R;
158
+ toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): R;
159
+ toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): R;
160
+ toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): R;
161
+ toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): R;
162
+ toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): R;
163
+ toHaveAccessibleProperty(property: Gtk.AccessibleProperty.AUTOCOMPLETE, expected?: Gtk.AccessibleAutocomplete): R;
164
+ toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): R;
165
+ toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): R;
166
+ toBeChecked(): R;
167
+ toBePartiallyChecked(): R;
168
+ toBePressed(): R;
169
+ toBePartiallyPressed(): R;
170
+ toBeDisabled(): R;
171
+ toBeEnabled(): R;
172
+ toBeVisible(): R;
173
+ toBeRooted(): R;
174
+ toBeEmptyWidget(): R;
175
+ toBeInvalid(): R;
176
+ toBeValid(): R;
177
+ toBeRequired(): R;
178
+ toHaveFocus(): R;
179
+ toHaveValue(expected?: number | string): R;
180
+ toHaveRole(expected: Gtk.AccessibleRole): R;
181
+ toContainElement(descendant: Gtk.Accessible | null): R;
182
+ toAppearBefore(other: Gtk.Accessible): R;
183
+ toAppearAfter(other: Gtk.Accessible): R;
184
+ toContainAnyByRole(...args: RoleQueryArgs): R;
185
+ toContainOneByRole(...args: RoleQueryArgs): R;
186
+ toContainAnyByText(...args: TextQueryArgs): R;
187
+ toContainOneByText(...args: TextQueryArgs): R;
188
+ toContainAnyByLabelText(...args: TextQueryArgs): R;
189
+ toContainOneByLabelText(...args: TextQueryArgs): R;
190
+ toContainAnyByPlaceholderText(...args: TextQueryArgs): R;
191
+ toContainOneByPlaceholderText(...args: TextQueryArgs): R;
192
+ toContainAnyByDisplayValue(...args: TextQueryArgs): R;
193
+ toContainOneByDisplayValue(...args: TextQueryArgs): R;
194
194
  toHaveClass(...args: (ClassExpectation | {
195
195
  exact: boolean;
196
- })[]): void;
197
- toHaveObjectProperty(name: string, expected?: unknown): void;
198
- }
199
- interface Assertion extends WidgetMatchers {
200
- }
201
- interface AsymmetricMatchersContaining extends WidgetMatchers {
196
+ })[]): R;
197
+ toHaveObjectProperty(name: string, expected?: unknown): R;
202
198
  }
203
199
  }
204
200
  export { matchers, registerMatchers, type ClassExpectation, type TextContentOptions, type TextExpectation };
@@ -1 +1 @@
1
- {"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../src/matchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAEH,KAAK,wBAAwB,EAKhC,MAAM,wBAAwB,CAAC;AAiChC,sFAAsF;AACtF,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvC,gFAAgF;AAChF,KAAK,kBAAkB,GAAG;IACtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,yFAAyF;AACzF,KAAK,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AACxC,yFAAyF;AACzF,KAAK,aAAa,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC;AAErE,0FAA0F;AAC1F,KAAK,cAAc,GAAG;IAClB,w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AC,YAAY,EAAE,CAAC;QAC5B,OAAO;IACX,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAE9B,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,OAAO;IACX,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxB,YAAY,CAAC,YAAY,GAAG,IAAI,CAAC;AACrC,CAAC,CAAC;AA8DF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAwE,CAAC","sourcesContent":["import type { SyncExpectationResult } from \"@vitest/expect\";\nimport * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ByRoleOptions, Matcher, MatcherOptions } from \"./types.js\";\nimport {\n ACCESSIBLE_NUMBER_TOLERANCE,\n type AccessibleAttributeValue,\n isAccessibleNumberMatch,\n isAccessibleNumberProperty,\n readAccessibleProperty,\n readAccessibleState,\n} from \"./accessible-native.js\";\nimport { getDefaultNormalizer } from \"./normalize.js\";\nimport {\n queryAllByDisplayValue,\n queryAllByLabelText,\n queryAllByPlaceholderText,\n queryAllByRole,\n queryAllByText,\n} from \"./queries.js\";\nimport { formatRole } from \"./role-helpers.js\";\nimport { type Container, descendants } from \"./traversal.js\";\nimport {\n type CheckedState,\n getWidgetAccessibleName,\n getWidgetCheckedState,\n getWidgetDescribedByText,\n getWidgetDisplayValue,\n getWidgetErrorMessage,\n getWidgetInvalidState,\n getWidgetLabelText,\n getWidgetPressedState,\n getWidgetRequiredState,\n getWidgetSelection,\n getWidgetTextContent,\n getWidgetValueNow,\n hasDisplayValue,\n isWidgetDisabled,\n isWidgetValueMatch,\n isWidgetVisible,\n} from \"./widget-accessible-properties.js\";\nimport { getTypeTag } from \"./widget-getters.js\";\nimport { isWindowActivated } from \"./window-state.js\";\n\n/** The expected value for a text matcher: an exact string or a regular expression. */\ntype TextExpectation = string | RegExp;\n\n/** Options controlling how `toHaveTextContent` normalizes the text it reads. */\ntype TextContentOptions = {\n /**\n * When true (the default), trim the text and collapse runs of whitespace into single spaces\n * before comparing. When false, only replace non-breaking spaces with regular ones.\n */\n normalizeWhitespace?: boolean | undefined;\n};\n\n/** The expected value for a style class: an exact class name or a regular expression. */\ntype ClassExpectation = string | RegExp;\n/** The outcome of a matcher: whether it passed, and the failure text built on demand. */\ntype MatcherResult = Pick<SyncExpectationResult, \"message\" | \"pass\">;\n\n/** The matcher state bound as `this`, supplying the test runner's deep equality check. */\ntype MatcherContext = {\n /** Compares a received value against an expected one, resolving asymmetric matchers. */\n equals: (actual: unknown, expected: unknown) => boolean;\n};\n\n/** Compares text read from the received widget; with no expected value, asserts the text is non-empty. */\ntype TextMatcher = (received: unknown, expected?: TextExpectation) => MatcherResult;\n/** Asserts a single state of the received widget, taking no expected value. */\ntype StateMatcher = (received: unknown) => MatcherResult;\n/** Trailing arguments of the `ByRole` query family, as a containment matcher takes them. */\ntype RoleQueryArgs = [role: Gtk.AccessibleRole, options?: ByRoleOptions];\n/** Trailing arguments of the text-based query families, as a containment matcher takes them. */\ntype TextQueryArgs = [text: Matcher, options?: MatcherOptions];\n/** Counts the descendants a query family finds under the received widget. */\ntype ContainmentMatcher<Args extends unknown[]> = (received: unknown, ...args: Args) => MatcherResult;\ntype TextMatcherContext = { matcherName: string; widget: Gtk.Widget; actual: string | null };\ntype ClassArguments = { expected: ClassExpectation[]; isExact: boolean };\ntype QueryAll<Args extends unknown[]> = (container: Container, ...args: Args) => object[];\n\ntype BooleanAccessibleState =\n Gtk.AccessibleState.BUSY |\n Gtk.AccessibleState.DISABLED |\n Gtk.AccessibleState.EXPANDED |\n Gtk.AccessibleState.HIDDEN |\n Gtk.AccessibleState.SELECTED |\n Gtk.AccessibleState.VISITED;\n\ntype TristateAccessibleState = Gtk.AccessibleState.CHECKED | Gtk.AccessibleState.PRESSED;\n\ntype StringAccessibleProperty =\n Gtk.AccessibleProperty.DESCRIPTION |\n Gtk.AccessibleProperty.HELP_TEXT |\n Gtk.AccessibleProperty.KEY_SHORTCUTS |\n Gtk.AccessibleProperty.LABEL |\n Gtk.AccessibleProperty.PLACEHOLDER |\n Gtk.AccessibleProperty.ROLE_DESCRIPTION |\n Gtk.AccessibleProperty.VALUE_TEXT;\n\ntype BooleanAccessibleProperty =\n Gtk.AccessibleProperty.HAS_POPUP |\n Gtk.AccessibleProperty.MODAL |\n Gtk.AccessibleProperty.MULTI_LINE |\n Gtk.AccessibleProperty.MULTI_SELECTABLE |\n Gtk.AccessibleProperty.READ_ONLY |\n Gtk.AccessibleProperty.REQUIRED;\n\ntype NumberAccessibleProperty =\n Gtk.AccessibleProperty.LEVEL |\n Gtk.AccessibleProperty.VALUE_MAX |\n Gtk.AccessibleProperty.VALUE_MIN |\n Gtk.AccessibleProperty.VALUE_NOW;\n\n/** A text matcher that also takes normalization options for the text it reads. */\ntype TextContentMatcher = (\n received: unknown,\n expected?: TextExpectation,\n options?: TextContentOptions,\n) => MatcherResult;\n\n/** Signatures of the widget assertion matchers, keyed by the name each is registered under. */\ntype MatcherImplementations = {\n /** Asserts the text an editable widget or combo box shows; with no argument, that it is not empty. */\n toHaveDisplayValue: TextMatcher;\n /** Asserts the widget's own text, or its descendants' when it has none, contains or matches the expectation. */\n toHaveTextContent: TextContentMatcher;\n /** Asserts the widget's accessible name; with no argument, that it has one. */\n toHaveAccessibleName: TextMatcher;\n /**\n * Asserts the joined accessible names of the widget's `described-by` targets, falling back to its\n * `description` and then to its tooltip.\n */\n toHaveAccessibleDescription: TextMatcher;\n /** Asserts the joined accessible names of the widget's `error-message` targets, read only while it is invalid. */\n toHaveAccessibleErrorMessage: TextMatcher;\n /** Asserts the text currently selected in an editable widget. */\n toHaveSelection: TextMatcher;\n /**\n * Asserts an accessible state GTK holds for the widget, taking the value type that state carries.\n * With no expected value, asserts only that the state is set to something determinate.\n */\n toHaveAccessibleState: (\n received: unknown,\n state: Gtk.AccessibleState,\n expected?: boolean | number,\n ) => MatcherResult;\n /**\n * Asserts an accessible property GTK holds for the widget, taking the value type that property\n * carries. With no expected value, asserts only that the property is set. Numeric properties\n * compare the way `toHaveValue` and the `value` option of the `ByRole` queries do, within 0.001.\n */\n toHaveAccessibleProperty: (\n received: unknown,\n property: Gtk.AccessibleProperty,\n expected?: AccessibleAttributeValue,\n ) => MatcherResult;\n /** Asserts the widget's checked state is checked rather than unchecked or mixed. */\n toBeChecked: StateMatcher;\n /** Asserts the widget's checked state is mixed. */\n toBePartiallyChecked: StateMatcher;\n /** Asserts a `Gtk.ToggleButton` is active, and throws for any other widget. */\n toBePressed: StateMatcher;\n /** Asserts the widget's accessible pressed state is mixed, and throws when it exposes none. */\n toBePartiallyPressed: StateMatcher;\n /** Asserts the widget is insensitive, or sits inside an insensitive ancestor. */\n toBeDisabled: StateMatcher;\n /** Asserts the widget and all of its ancestors are sensitive. */\n toBeEnabled: StateMatcher;\n /** Asserts the widget and its ancestors are all visible, and that none of them is fully transparent. */\n toBeVisible: StateMatcher;\n /** Asserts the widget's root is a window that is still in the toplevel list. */\n toBeRooted: StateMatcher;\n /** Asserts the widget has neither a child nor label text. */\n toBeEmptyWidget: StateMatcher;\n /** Asserts the widget's accessible invalid state is set to anything other than false. */\n toBeInvalid: StateMatcher;\n /** Asserts the widget's accessible invalid state is unset or false. */\n toBeValid: StateMatcher;\n /** Asserts the widget's accessible required state. */\n toBeRequired: StateMatcher;\n /** Asserts the widget holds the platform focus state. */\n toHaveFocus: StateMatcher;\n /**\n * Asserts a widget's numeric value, or its display value when a string is given.\n *\n * Numbers come from the accessibility tree, which GTK keeps to a resolution of 0.001: it drops an\n * update whose value is nearer than that to the one already published, so a widget that moves by\n * less keeps its previous value. Numbers therefore match within 0.001, the same tolerance the\n * `value` option of the `ByRole` queries and `toHaveAccessibleProperty` apply. That option reads\n * the same tree, where the maximum of a paged widget such as a scrollbar is the last value it can\n * reach, its adjustment's upper bound less one page.\n */\n toHaveValue: (received: unknown, expected?: number | string) => MatcherResult;\n /** Asserts the widget's accessible role. */\n toHaveRole: (received: unknown, expected: Gtk.AccessibleRole) => MatcherResult;\n /** Asserts the widget is, or is an ancestor of, the given widget. */\n toContainElement: (received: unknown, descendant: Gtk.Accessible | null) => MatcherResult;\n /** Asserts the widget comes before the given widget in the widget tree, neither containing the other. */\n toAppearBefore: (received: unknown, other: Gtk.Accessible) => MatcherResult;\n /** Asserts the widget comes after the given widget in the widget tree, neither containing the other. */\n toAppearAfter: (received: unknown, other: Gtk.Accessible) => MatcherResult;\n /** Asserts at least one widget under the received one matches the `ByRole` query. */\n toContainAnyByRole: ContainmentMatcher<RoleQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByRole` query. */\n toContainOneByRole: ContainmentMatcher<RoleQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByText` query. */\n toContainAnyByText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByText` query. */\n toContainOneByText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByLabelText` query. */\n toContainAnyByLabelText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByLabelText` query. */\n toContainOneByLabelText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByPlaceholderText` query. */\n toContainAnyByPlaceholderText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByPlaceholderText` query. */\n toContainOneByPlaceholderText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByDisplayValue` query. */\n toContainAnyByDisplayValue: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByDisplayValue` query. */\n toContainOneByDisplayValue: ContainmentMatcher<TextQueryArgs>;\n /**\n * Asserts the widget carries every given style class, each a name, a space-separated list, or a pattern.\n * Pass `{ exact: true }` last to require exactly that set, which rules out patterns.\n */\n toHaveClass: (received: unknown, ...args: unknown[]) => MatcherResult;\n /**\n * Asserts a GObject property, named as in GObject and looked up by its camel-cased accessor, equals the\n * expected value. With no expected value, asserts the property is set. GObject values compare by identity.\n */\n toHaveObjectProperty: (this: MatcherContext, received: unknown, ...args: unknown[]) => MatcherResult;\n};\n\ntype ExpectExtend = { extend: (m: MatcherImplementations) => void };\n\ntype AttributeExpectation = {\n label: string;\n comparison: string;\n expected: AccessibleAttributeValue;\n actual: AccessibleAttributeValue | null;\n isPass: boolean;\n isReadingRounded: boolean;\n};\n\nconst registration = { isRegistered: false };\nconst MIXED_TRISTATE: number = Gtk.AccessibleTristate.MIXED;\nconst ROUNDED_READING = \", which the accessibility tree rounds to six significant digits\";\nconst displayValueMatcher: TextMatcher = textMatcher(\"toHaveDisplayValue\", getWidgetDisplayValue, \"exact\");\nconst toHaveAccessibleName: TextMatcher = textMatcher(\"toHaveAccessibleName\", getWidgetAccessibleName, \"exact\");\n\nconst toHaveAccessibleDescription: TextMatcher = textMatcher(\n \"toHaveAccessibleDescription\",\n getWidgetDescribedByText,\n \"exact\",\n);\n\nconst toHaveAccessibleErrorMessage: TextMatcher = textMatcher(\n \"toHaveAccessibleErrorMessage\",\n readErrorMessageText,\n \"exact\",\n);\n\nconst toHaveSelection: TextMatcher = textMatcher(\"toHaveSelection\", getWidgetSelection, \"exact\");\nconst toBePressed: StateMatcher = booleanStateMatcher(\"toBePressed\", \"pressed\", getWidgetPressedState);\nconst toBeRequired: StateMatcher = booleanStateMatcher(\"toBeRequired\", \"required\", getWidgetRequiredState);\n\nconst toContainAnyByRole: ContainmentMatcher<RoleQueryArgs> = containmentMatcher(\n \"toContainAnyByRole\",\n false,\n queryAllByRole,\n);\n\nconst toContainOneByRole: ContainmentMatcher<RoleQueryArgs> = containmentMatcher(\n \"toContainOneByRole\",\n true,\n queryAllByRole,\n);\n\nconst toContainAnyByText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByText\",\n false,\n queryAllByText,\n);\n\nconst toContainOneByText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByText\",\n true,\n queryAllByText,\n);\n\nconst toContainAnyByLabelText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByLabelText\",\n false,\n queryAllByLabelText,\n);\n\nconst toContainOneByLabelText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByLabelText\",\n true,\n queryAllByLabelText,\n);\n\nconst toContainAnyByPlaceholderText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByPlaceholderText\",\n false,\n queryAllByPlaceholderText,\n);\n\nconst toContainOneByPlaceholderText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByPlaceholderText\",\n true,\n queryAllByPlaceholderText,\n);\n\nconst toContainAnyByDisplayValue: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByDisplayValue\",\n false,\n queryAllByDisplayValue,\n);\n\nconst toContainOneByDisplayValue: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByDisplayValue\",\n true,\n queryAllByDisplayValue,\n);\n\n/** The widget assertion matchers keyed by name, suitable for passing to `expect.extend`. */\nconst matchers: MatcherImplementations = {\n toHaveDisplayValue,\n toHaveTextContent,\n toHaveAccessibleName,\n toHaveAccessibleDescription,\n toHaveAccessibleErrorMessage,\n toHaveSelection,\n toHaveAccessibleState,\n toHaveAccessibleProperty,\n toBeChecked,\n toBePartiallyChecked,\n toBePressed,\n toBePartiallyPressed,\n toBeDisabled,\n toBeEnabled,\n toBeVisible,\n toBeRooted,\n toBeEmptyWidget,\n toBeInvalid,\n toBeValid,\n toBeRequired,\n toHaveFocus,\n toHaveValue,\n toHaveRole,\n toContainElement,\n toAppearBefore,\n toAppearAfter,\n toContainAnyByRole,\n toContainOneByRole,\n toContainAnyByText,\n toContainOneByText,\n toContainAnyByLabelText,\n toContainOneByLabelText,\n toContainAnyByPlaceholderText,\n toContainOneByPlaceholderText,\n toContainAnyByDisplayValue,\n toContainOneByDisplayValue,\n toHaveClass,\n toHaveObjectProperty,\n};\n\nconst asWidget = (received: unknown, matcherName: string): Gtk.Widget => {\n if (!(received instanceof Gtk.Widget)) {\n throw new TypeError(`${matcherName}: received value must be a Gtk.Widget, got ${typeof received}`);\n }\n\n return received;\n};\n\nconst asObject = (received: unknown, matcherName: string): GObject.Object => {\n if (!(received instanceof GObject.Object)) {\n throw new TypeError(`${matcherName}: received value must be a GObject, got ${typeof received}`);\n }\n\n return received;\n};\n\nconst describeWidget = (widget: Gtk.Widget): string => {\n const role = Gtk.AccessibleRole[widget.getAccessibleRole()];\n const name = getWidgetAccessibleName(widget);\n\n return name === null ? `<${role}>` : `<${role} name=${JSON.stringify(name)}>`;\n};\n\nconst describeObject = (object: GObject.Object): string =>\n object instanceof Gtk.Widget ? describeWidget(object) : `<${getTypeTag(object)}>`;\n\nconst isTextMatch = (actual: string, expected: TextExpectation, mode: \"exact\" | \"substring\"): boolean => {\n if (expected instanceof RegExp) {\n expected.lastIndex = 0;\n\n return expected.test(actual);\n }\n\n return mode === \"exact\" ? actual === expected : actual.includes(expected);\n};\n\nconst describeExpected = (expected: TextExpectation): string =>\n expected instanceof RegExp ? String(expected) : JSON.stringify(expected);\n\nconst negationPrefix = (isPass: boolean): string => (isPass ? \"not \" : \"\");\n\nconst nonEmptyResult = ({ matcherName, widget, actual }: TextMatcherContext): MatcherResult => {\n const isPass = actual !== null && actual !== \"\";\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have a non-empty value for ${matcherName}, ` +\n `but got ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n};\n\nconst matchedResult = (context: TextMatcherContext, expected: TextExpectation, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}${context.matcherName} ${describeExpected(expected)}, ` +\n `but received ${JSON.stringify(context.actual)}\\n${describeWidget(context.widget)}`,\n});\n\nconst stateResult = (widget: Gtk.Widget, stateName: string, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () => `expected widget ${negationPrefix(isPass)}to be ${stateName}\\n${describeWidget(widget)}`,\n});\n\nconst isHoldingFocus = (widget: Gtk.Widget, root: Gtk.Window): boolean => {\n const focus = root.getFocus();\n\n return focus !== null && (focus === widget || focus.isAncestor(widget));\n};\n\nconst isFocusHeldByInactiveWindow = (widget: Gtk.Widget): boolean => {\n const root = widget.getRoot();\n\n return root instanceof Gtk.Window && !isWindowActivated(root) && isHoldingFocus(widget, root);\n};\n\nconst focusResult = (widget: Gtk.Widget, isPass: boolean): MatcherResult => {\n if (isPass || !isFocusHeldByInactiveWindow(widget)) {\n return stateResult(widget, \"focused\", isPass);\n }\n\n return {\n pass: false,\n message: () =>\n \"expected widget to be focused: its window has given it the focus, \" +\n `but that window is not active\\n${describeWidget(widget)}`,\n };\n};\n\nconst describeAttributeValue = (value: AccessibleAttributeValue | null): string =>\n value === null ? \"unset\" : JSON.stringify(value);\n\nconst attributeSetResult = (\n widget: Gtk.Widget,\n label: string,\n actual: AccessibleAttributeValue | null,\n): MatcherResult => {\n const isSet = actual !== null;\n\n return {\n pass: isSet,\n message: () => `expected widget ${negationPrefix(isSet)}to have ${label} set\\n${describeWidget(widget)}`,\n };\n};\n\nconst describeReading = (expectation: AttributeExpectation): string =>\n `${describeAttributeValue(expectation.actual)}${expectation.isReadingRounded ? ROUNDED_READING : \"\"}`;\n\nconst attributeValueResult = (widget: Gtk.Widget, expectation: AttributeExpectation): MatcherResult => ({\n pass: expectation.isPass,\n message: () =>\n `expected widget ${negationPrefix(expectation.isPass)}to have ${expectation.label} ` +\n `${expectation.comparison} ${describeAttributeValue(expectation.expected)}, but received ` +\n `${describeReading(expectation)}\\n${describeWidget(widget)}`,\n});\n\nconst orderResult = (widget: Gtk.Widget, other: Gtk.Widget, position: string, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to appear ${position} ${describeWidget(other)} ` +\n `in the widget tree\\n${describeWidget(widget)}`,\n});\n\nconst getTreeRoot = (widget: Gtk.Widget): Gtk.Widget => {\n let root = widget;\n let parent = root.getParent();\n\n while (parent) {\n root = parent;\n parent = root.getParent();\n }\n\n return root;\n};\n\nconst isSeparateWidget = (first: Gtk.Widget, second: Gtk.Widget): boolean =>\n first !== second && !first.isAncestor(second) && !second.isAncestor(first);\n\nconst isPrecedingWidget = (root: Gtk.Widget, first: Gtk.Widget, second: Gtk.Widget): boolean => {\n for (const widget of descendants(root)) {\n if (widget === first) {\n return true;\n }\n\n if (widget === second) {\n return false;\n }\n }\n\n return false;\n};\n\nconst isAppearingBefore = (first: Gtk.Widget, second: Gtk.Widget): boolean => {\n const root = getTreeRoot(first);\n\n return isSeparateWidget(first, second) && root === getTreeRoot(second) && isPrecedingWidget(root, first, second);\n};\n\nconst isAsymmetricMatcher = (value: unknown): boolean =>\n typeof value === \"object\" && value !== null && typeof Reflect.get(value, \"asymmetricMatch\") === \"function\";\n\nconst isEqualValue = (context: MatcherContext, actual: unknown, expected: unknown): boolean => {\n if (isAsymmetricMatcher(expected)) {\n return context.equals(actual, expected);\n }\n\n if (actual instanceof GObject.Object || expected instanceof GObject.Object) {\n return Object.is(actual, expected);\n }\n\n return context.equals(actual, expected);\n};\n\nconst isClassMatch = (actual: string[], expected: ClassExpectation): boolean =>\n expected instanceof RegExp ? actual.some((name) => expected.test(name)) : actual.includes(expected);\n\nconst isWidgetRooted = (widget: Gtk.Widget): boolean => {\n const root = widget.getRoot();\n\n if (root === null) {\n return false;\n }\n\n if (root instanceof Gtk.Window) {\n return Gtk.Window.listToplevels().includes(root);\n }\n\n return true;\n};\n\nconst globalExpect = (): ExpectExtend | null => {\n const candidate: unknown = Reflect.get(globalThis, \"expect\");\n\n if (candidate && typeof (candidate as ExpectExtend).extend === \"function\") {\n return candidate as ExpectExtend;\n }\n\n return null;\n};\n\nfunction readErrorMessageText(widget: Gtk.Widget): string | null {\n const state = getWidgetInvalidState(widget);\n\n if (state === null || state === Gtk.AccessibleInvalidState.FALSE) {\n return null;\n }\n\n const targets = getWidgetErrorMessage(widget);\n\n if (targets === null) {\n return null;\n }\n\n const texts = targets.map((target) => getWidgetAccessibleName(target)).filter((text) => text !== null);\n\n return texts.length > 0 ? texts.join(\" \") : null;\n}\n\nfunction readObjectProperty(object: GObject.Object, name: string): unknown {\n const value: unknown = Reflect.apply(GObject.getProperty, undefined, [object, name]);\n\n return value;\n}\n\nfunction classEntries(entry: unknown): ClassExpectation[] {\n return entry instanceof RegExp ? [entry] : String(entry).split(/\\s+/).filter(Boolean);\n}\n\nfunction parseClassArguments(args: unknown[]): ClassArguments {\n const last = args.at(-1);\n const isOptions = typeof last === \"object\" && last !== null && !(last instanceof RegExp);\n const isExact = isOptions && Reflect.get(last, \"exact\") === true;\n const entries = isOptions ? args.slice(0, -1) : args;\n\n return { expected: entries.flatMap((entry) => classEntries(entry)), isExact };\n}\n\nfunction exactClassResult(widget: Gtk.Widget, actual: string[], expected: ClassExpectation[]): MatcherResult {\n if (expected.some((entry) => entry instanceof RegExp)) {\n throw new TypeError(\"toHaveClass: the exact option cannot be combined with a regular expression\");\n }\n\n const names = expected.map(String);\n const isPass = names.length === actual.length && names.every((name) => actual.includes(name));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have exactly the classes ${JSON.stringify(names)}, ` +\n `but received ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction textMatcher(\n matcherName: string,\n read: (widget: Gtk.Widget) => string | null,\n mode: \"exact\" | \"substring\",\n): TextMatcher {\n return (received: unknown, expected?: TextExpectation): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const actual = read(widget);\n const context: TextMatcherContext = { matcherName, widget, actual };\n\n if (expected === undefined) {\n return nonEmptyResult(context);\n }\n\n return matchedResult(context, expected, actual !== null && isTextMatch(actual, expected, mode));\n };\n}\n\nfunction normalizeTextContent(text: string, options?: TextContentOptions): string {\n if (options?.normalizeWhitespace === false) {\n return text.replaceAll(\"\\u{A0}\", \" \");\n }\n\n return getDefaultNormalizer()(text);\n}\n\nfunction readTextContent(widget: Gtk.Widget, options?: TextContentOptions): string | null {\n const text = getWidgetTextContent(widget);\n\n return text === null ? null : normalizeTextContent(text, options);\n}\n\nfunction toHaveTextContent(\n received: unknown,\n expected?: TextExpectation,\n options?: TextContentOptions,\n): MatcherResult {\n const read = (widget: Gtk.Widget): string | null => readTextContent(widget, options);\n\n return textMatcher(\"toHaveTextContent\", read, \"substring\")(received, expected);\n}\n\nfunction notApplicable(matcherName: string, stateName: string, widget: Gtk.Widget): Error {\n return new Error(\n `${matcherName}: widget does not expose a ${stateName} ` +\n `(role ${Gtk.AccessibleRole[widget.getAccessibleRole()]})\\n${describeWidget(widget)}`,\n );\n}\n\nfunction booleanStateMatcher(\n matcherName: string,\n stateName: string,\n read: (widget: Gtk.Widget) => boolean | null,\n): StateMatcher {\n return (received: unknown): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const state = read(widget);\n\n if (state === null) {\n throw notApplicable(matcherName, `${stateName} state`, widget);\n }\n\n return stateResult(widget, stateName, state);\n };\n}\n\nfunction containmentMatcher<Args extends unknown[]>(\n matcherName: string,\n isSingle: boolean,\n queryAll: QueryAll<Args>,\n): ContainmentMatcher<Args> {\n const quantity = isSingle ? \"exactly one widget\" : \"any widget\";\n\n return (received: unknown, ...args: Args): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const matches = queryAll(widget, ...args);\n const isPass = isSingle ? matches.length === 1 : matches.length > 0;\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to contain ${quantity} matching ${matcherName}, ` +\n `but found ${String(matches.length)}\\n${describeWidget(widget)}`,\n };\n };\n}\n\nfunction toHaveAccessibleState(\n received: unknown,\n state: Gtk.AccessibleState,\n expected?: boolean | number,\n): MatcherResult {\n const widget = asWidget(received, \"toHaveAccessibleState\");\n const actual = readAccessibleState(widget, state);\n const label = `accessible state ${Gtk.AccessibleState[state]}`;\n\n if (expected === undefined) {\n return attributeSetResult(widget, label, actual);\n }\n\n const wanted = typeof expected === \"boolean\" ? Number(expected) : expected;\n\n return attributeValueResult(widget, {\n label,\n comparison: \"equal to\",\n expected: wanted,\n actual,\n isPass: actual === wanted,\n isReadingRounded: false,\n });\n}\n\nconst propertyLabel = (property: Gtk.AccessibleProperty): string =>\n `accessible property ${Gtk.AccessibleProperty[property]}`;\n\nconst propertyExpectation = (\n widget: Gtk.Widget,\n property: Gtk.AccessibleProperty,\n expected: AccessibleAttributeValue,\n actual: AccessibleAttributeValue | null,\n): AttributeExpectation => {\n const label = propertyLabel(property);\n\n if (typeof expected === \"number\" && isAccessibleNumberProperty(property)) {\n return {\n label,\n comparison: `within ${String(ACCESSIBLE_NUMBER_TOLERANCE)} of`,\n expected,\n actual,\n isPass: isAccessibleNumberMatch(widget, property, expected),\n isReadingRounded: actual !== null,\n };\n }\n\n return { label, comparison: \"equal to\", expected, actual, isPass: actual === expected, isReadingRounded: false };\n};\n\nfunction toHaveAccessibleProperty(\n received: unknown,\n property: Gtk.AccessibleProperty,\n expected?: AccessibleAttributeValue,\n): MatcherResult {\n const widget = asWidget(received, \"toHaveAccessibleProperty\");\n const actual = readAccessibleProperty(widget, property);\n\n if (expected === undefined) {\n return attributeSetResult(widget, propertyLabel(property), actual);\n }\n\n return attributeValueResult(widget, propertyExpectation(widget, property, expected, actual));\n}\n\nfunction toBePartiallyPressed(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBePartiallyPressed\");\n const state = readAccessibleState(widget, Gtk.AccessibleState.PRESSED);\n\n if (state === null) {\n throw notApplicable(\"toBePartiallyPressed\", \"pressed state\", widget);\n }\n\n return stateResult(widget, \"partially pressed\", state === MIXED_TRISTATE);\n}\n\nfunction toAppearBefore(received: unknown, other: Gtk.Accessible): MatcherResult {\n const widget = asWidget(received, \"toAppearBefore\");\n const target = asWidget(other, \"toAppearBefore\");\n\n return orderResult(widget, target, \"before\", isAppearingBefore(widget, target));\n}\n\nfunction toAppearAfter(received: unknown, other: Gtk.Accessible): MatcherResult {\n const widget = asWidget(received, \"toAppearAfter\");\n const target = asWidget(other, \"toAppearAfter\");\n\n return orderResult(widget, target, \"after\", isAppearingBefore(target, widget));\n}\n\nfunction readCheckedState(widget: Gtk.Widget, matcherName: string): CheckedState {\n const state = getWidgetCheckedState(widget);\n\n if (state === null) {\n throw notApplicable(matcherName, \"checked state\", widget);\n }\n\n return state;\n}\n\nfunction toBeChecked(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeChecked\");\n\n return stateResult(widget, \"checked\", readCheckedState(widget, \"toBeChecked\") === \"checked\");\n}\n\nfunction toBePartiallyChecked(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBePartiallyChecked\");\n\n return stateResult(widget, \"partially checked\", readCheckedState(widget, \"toBePartiallyChecked\") === \"mixed\");\n}\n\nfunction toHaveDisplayValue(received: unknown, expected?: TextExpectation): MatcherResult {\n const widget = asWidget(received, \"toHaveDisplayValue\");\n\n if (!hasDisplayValue(widget)) {\n throw notApplicable(\"toHaveDisplayValue\", \"display value\", widget);\n }\n\n return displayValueMatcher(received, expected);\n}\n\nconst describeValueExpectation = (expected: number | undefined): string =>\n expected === undefined ? \"set\" : `within ${String(ACCESSIBLE_NUMBER_TOLERANCE)} of ${String(expected)}`;\n\nfunction toHaveValue(received: unknown, expected?: number | string): MatcherResult {\n const widget = asWidget(received, \"toHaveValue\");\n\n if (typeof expected === \"string\") {\n return displayValueMatcher(received, expected);\n }\n\n const actual = getWidgetValueNow(widget);\n\n if (actual === null) {\n throw notApplicable(\"toHaveValue\", \"numeric value\", widget);\n }\n\n const isPass = expected === undefined || isWidgetValueMatch(widget, \"now\", expected);\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have value ${describeValueExpectation(expected)}, ` +\n `but received ${String(actual)}${ROUNDED_READING}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toBeDisabled(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeDisabled\");\n\n return stateResult(widget, \"disabled\", isWidgetDisabled(widget));\n}\n\nfunction toBeEnabled(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeEnabled\");\n\n return stateResult(widget, \"enabled\", !isWidgetDisabled(widget));\n}\n\nfunction toBeVisible(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeVisible\");\n\n return stateResult(widget, \"visible\", isWidgetVisible(widget));\n}\n\nfunction toBeRooted(received: unknown): MatcherResult {\n if (received === null) {\n return { pass: false, message: () => \"expected a widget to be rooted in a window, but received null\" };\n }\n\n const widget = asWidget(received, \"toBeRooted\");\n\n return stateResult(widget, \"rooted in a window\", isWidgetRooted(widget));\n}\n\nfunction toBeEmptyWidget(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeEmptyWidget\");\n\n return stateResult(widget, \"empty\", widget.getFirstChild() === null && getWidgetLabelText(widget) === null);\n}\n\nfunction toBeInvalid(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeInvalid\");\n const state = getWidgetInvalidState(widget);\n\n return stateResult(widget, \"invalid\", state !== null && state !== Gtk.AccessibleInvalidState.FALSE);\n}\n\nfunction toBeValid(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeValid\");\n const state = getWidgetInvalidState(widget);\n\n return stateResult(widget, \"valid\", state === null || state === Gtk.AccessibleInvalidState.FALSE);\n}\n\nfunction toHaveFocus(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toHaveFocus\");\n\n return focusResult(widget, widget.getPlatformState(Gtk.AccessiblePlatformState.FOCUSED));\n}\n\nfunction toHaveRole(received: unknown, expected: Gtk.AccessibleRole): MatcherResult {\n const widget = asWidget(received, \"toHaveRole\");\n const actual = widget.getAccessibleRole();\n const isPass = actual === expected;\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have role '${formatRole(expected)}', ` +\n `but received '${formatRole(actual)}'\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toContainElement(received: unknown, descendant: Gtk.Accessible | null): MatcherResult {\n const widget = asWidget(received, \"toContainElement\");\n const target = descendant === null ? null : asWidget(descendant, \"toContainElement\");\n const isPass = target !== null && (target === widget || target.isAncestor(widget));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to contain ` +\n `${target === null ? \"null\" : describeWidget(target)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toHaveClass(received: unknown, ...args: unknown[]): MatcherResult {\n const widget = asWidget(received, \"toHaveClass\");\n const actual = widget.getCssClasses();\n const { expected, isExact } = parseClassArguments(args);\n\n if (isExact) {\n return exactClassResult(widget, actual, expected);\n }\n\n if (expected.length === 0) {\n return stateResult(widget, \"given any style class\", actual.length > 0);\n }\n\n const isPass = expected.every((entry) => isClassMatch(actual, entry));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have class ${expected.map(String).join(\", \")}, ` +\n `but received ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toHaveObjectProperty(this: MatcherContext, received: unknown, ...args: unknown[]): MatcherResult {\n const object = asObject(received, \"toHaveObjectProperty\");\n const [name, expected] = args;\n const actual = readObjectProperty(object, String(name));\n\n if (args.length < 2) {\n const isSet = actual !== null && actual !== undefined;\n\n return {\n pass: isSet,\n message: () =>\n `expected ${describeObject(object)} ${negationPrefix(isSet)}to have a value for property ` +\n `\"${String(name)}\", but received ${JSON.stringify(actual)}`,\n };\n }\n\n const isPass = isEqualValue(this, actual, expected);\n\n return {\n pass: isPass,\n message: () =>\n `expected ${describeObject(object)} ${negationPrefix(isPass)}to have property \"${String(name)}\" ` +\n `equal to ${JSON.stringify(expected)}, but received ${JSON.stringify(actual)}`,\n };\n}\n\n/** Registers the widget matchers on the global `expect`, when one is available. Safe to call more than once. */\nconst registerMatchers = (): void => {\n if (registration.isRegistered) {\n return;\n }\n\n const expect = globalExpect();\n\n if (!expect) {\n return;\n }\n\n expect.extend(matchers);\n registration.isRegistered = true;\n};\n\ndeclare module \"@vitest/expect\" {\n /* eslint-disable @typescript-eslint/consistent-type-definitions -- declaration merging requires interfaces */\n interface WidgetMatchers {\n toHaveDisplayValue(expected?: TextExpectation): void;\n toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): void;\n toHaveAccessibleName(expected?: TextExpectation): void;\n toHaveAccessibleDescription(expected?: TextExpectation): void;\n toHaveAccessibleErrorMessage(expected?: TextExpectation): void;\n toHaveSelection(expected?: TextExpectation): void;\n /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */\n toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): void;\n toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): void;\n toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): void;\n toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): void;\n /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */\n toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): void;\n toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): void;\n toHaveAccessibleProperty(\n property: Gtk.AccessibleProperty.AUTOCOMPLETE,\n expected?: Gtk.AccessibleAutocomplete,\n ): void;\n toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): void;\n toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): void;\n toBeChecked(): void;\n toBePartiallyChecked(): void;\n toBePressed(): void;\n toBePartiallyPressed(): void;\n toBeDisabled(): void;\n toBeEnabled(): void;\n toBeVisible(): void;\n toBeRooted(): void;\n toBeEmptyWidget(): void;\n toBeInvalid(): void;\n toBeValid(): void;\n toBeRequired(): void;\n toHaveFocus(): void;\n toHaveValue(expected?: number | string): void;\n toHaveRole(expected: Gtk.AccessibleRole): void;\n toContainElement(descendant: Gtk.Accessible | null): void;\n toAppearBefore(other: Gtk.Accessible): void;\n toAppearAfter(other: Gtk.Accessible): void;\n toContainAnyByRole(...args: RoleQueryArgs): void;\n toContainOneByRole(...args: RoleQueryArgs): void;\n toContainAnyByText(...args: TextQueryArgs): void;\n toContainOneByText(...args: TextQueryArgs): void;\n toContainAnyByLabelText(...args: TextQueryArgs): void;\n toContainOneByLabelText(...args: TextQueryArgs): void;\n toContainAnyByPlaceholderText(...args: TextQueryArgs): void;\n toContainOneByPlaceholderText(...args: TextQueryArgs): void;\n toContainAnyByDisplayValue(...args: TextQueryArgs): void;\n toContainOneByDisplayValue(...args: TextQueryArgs): void;\n toHaveClass(...args: (ClassExpectation | { exact: boolean })[]): void;\n toHaveObjectProperty(name: string, expected?: unknown): void;\n }\n\n interface Assertion extends WidgetMatchers {}\n interface AsymmetricMatchersContaining extends WidgetMatchers {}\n /* eslint-enable @typescript-eslint/consistent-type-definitions */\n}\n\nexport { matchers, registerMatchers, type ClassExpectation, type TextContentOptions, type TextExpectation };\n"]}
1
+ {"version":3,"file":"matchers.js","sourceRoot":"","sources":["../src/matchers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,EACH,2BAA2B,EAE3B,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACH,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,cAAc,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAkB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAEH,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,E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atcherResult } from \"vitest\";\nimport * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ByRoleOptions, Matcher, MatcherOptions } from \"./types.js\";\nimport {\n ACCESSIBLE_NUMBER_TOLERANCE,\n type AccessibleAttributeValue,\n isAccessibleNumberMatch,\n isAccessibleNumberProperty,\n readAccessibleProperty,\n readAccessibleState,\n} from \"./accessible-native.js\";\nimport { getDefaultNormalizer } from \"./normalize.js\";\nimport {\n queryAllByDisplayValue,\n queryAllByLabelText,\n queryAllByPlaceholderText,\n queryAllByRole,\n queryAllByText,\n} from \"./queries.js\";\nimport { formatRole } from \"./role-helpers.js\";\nimport { type Container, descendants } from \"./traversal.js\";\nimport {\n type CheckedState,\n getWidgetAccessibleName,\n getWidgetCheckedState,\n getWidgetDescribedByText,\n getWidgetDisplayValue,\n getWidgetErrorMessage,\n getWidgetInvalidState,\n getWidgetLabelText,\n getWidgetPressedState,\n getWidgetRequiredState,\n getWidgetSelection,\n getWidgetTextContent,\n getWidgetValueNow,\n hasDisplayValue,\n isWidgetDisabled,\n isWidgetValueMatch,\n isWidgetVisible,\n} from \"./widget-accessible-properties.js\";\nimport { getTypeTag } from \"./widget-getters.js\";\nimport { isWindowActivated } from \"./window-state.js\";\n\n/** The expected value for a text matcher: an exact string or a regular expression. */\ntype TextExpectation = string | RegExp;\n\n/** Options controlling how `toHaveTextContent` normalizes the text it reads. */\ntype TextContentOptions = {\n /**\n * When true (the default), trim the text and collapse runs of whitespace into single spaces\n * before comparing. When false, only replace non-breaking spaces with regular ones.\n */\n normalizeWhitespace?: boolean | undefined;\n};\n\n/** The expected value for a style class: an exact class name or a regular expression. */\ntype ClassExpectation = string | RegExp;\n/** The outcome of a matcher: whether it passed, and the failure text built on demand. */\ntype MatcherResult = Pick<SyncMatcherResult, \"message\" | \"pass\">;\n\n/** The matcher state bound as `this`, supplying the test runner's deep equality check. */\ntype MatcherContext = {\n /** Compares a received value against an expected one, resolving asymmetric matchers. */\n equals: (actual: unknown, expected: unknown) => boolean;\n};\n\n/** Compares text read from the received widget; with no expected value, asserts the text is non-empty. */\ntype TextMatcher = (received: unknown, expected?: TextExpectation) => MatcherResult;\n/** Asserts a single state of the received widget, taking no expected value. */\ntype StateMatcher = (received: unknown) => MatcherResult;\n/** Trailing arguments of the `ByRole` query family, as a containment matcher takes them. */\ntype RoleQueryArgs = [role: Gtk.AccessibleRole, options?: ByRoleOptions];\n/** Trailing arguments of the text-based query families, as a containment matcher takes them. */\ntype TextQueryArgs = [text: Matcher, options?: MatcherOptions];\n/** Counts the descendants a query family finds under the received widget. */\ntype ContainmentMatcher<Args extends unknown[]> = (received: unknown, ...args: Args) => MatcherResult;\ntype TextMatcherContext = { matcherName: string; widget: Gtk.Widget; actual: string | null };\ntype ClassArguments = { expected: ClassExpectation[]; isExact: boolean };\ntype QueryAll<Args extends unknown[]> = (container: Container, ...args: Args) => object[];\n\ntype BooleanAccessibleState =\n Gtk.AccessibleState.BUSY |\n Gtk.AccessibleState.DISABLED |\n Gtk.AccessibleState.EXPANDED |\n Gtk.AccessibleState.HIDDEN |\n Gtk.AccessibleState.SELECTED |\n Gtk.AccessibleState.VISITED;\n\ntype TristateAccessibleState = Gtk.AccessibleState.CHECKED | Gtk.AccessibleState.PRESSED;\n\ntype StringAccessibleProperty =\n Gtk.AccessibleProperty.DESCRIPTION |\n Gtk.AccessibleProperty.HELP_TEXT |\n Gtk.AccessibleProperty.KEY_SHORTCUTS |\n Gtk.AccessibleProperty.LABEL |\n Gtk.AccessibleProperty.PLACEHOLDER |\n Gtk.AccessibleProperty.ROLE_DESCRIPTION |\n Gtk.AccessibleProperty.VALUE_TEXT;\n\ntype BooleanAccessibleProperty =\n Gtk.AccessibleProperty.HAS_POPUP |\n Gtk.AccessibleProperty.MODAL |\n Gtk.AccessibleProperty.MULTI_LINE |\n Gtk.AccessibleProperty.MULTI_SELECTABLE |\n Gtk.AccessibleProperty.READ_ONLY |\n Gtk.AccessibleProperty.REQUIRED;\n\ntype NumberAccessibleProperty =\n Gtk.AccessibleProperty.LEVEL |\n Gtk.AccessibleProperty.VALUE_MAX |\n Gtk.AccessibleProperty.VALUE_MIN |\n Gtk.AccessibleProperty.VALUE_NOW;\n\n/** A text matcher that also takes normalization options for the text it reads. */\ntype TextContentMatcher = (\n received: unknown,\n expected?: TextExpectation,\n options?: TextContentOptions,\n) => MatcherResult;\n\n/** Signatures of the widget assertion matchers, keyed by the name each is registered under. */\ntype MatcherImplementations = {\n /** Asserts the text an editable widget or combo box shows; with no argument, that it is not empty. */\n toHaveDisplayValue: TextMatcher;\n /** Asserts the widget's own text, or its descendants' when it has none, contains or matches the expectation. */\n toHaveTextContent: TextContentMatcher;\n /** Asserts the widget's accessible name; with no argument, that it has one. */\n toHaveAccessibleName: TextMatcher;\n /**\n * Asserts the joined accessible names of the widget's `described-by` targets, falling back to its\n * `description` and then to its tooltip.\n */\n toHaveAccessibleDescription: TextMatcher;\n /** Asserts the joined accessible names of the widget's `error-message` targets, read only while it is invalid. */\n toHaveAccessibleErrorMessage: TextMatcher;\n /** Asserts the text currently selected in an editable widget. */\n toHaveSelection: TextMatcher;\n /**\n * Asserts an accessible state GTK holds for the widget, taking the value type that state carries.\n * With no expected value, asserts only that the state is set to something determinate.\n */\n toHaveAccessibleState: (\n received: unknown,\n state: Gtk.AccessibleState,\n expected?: boolean | number,\n ) => MatcherResult;\n /**\n * Asserts an accessible property GTK holds for the widget, taking the value type that property\n * carries. With no expected value, asserts only that the property is set. Numeric properties\n * compare the way `toHaveValue` and the `value` option of the `ByRole` queries do, within 0.001.\n */\n toHaveAccessibleProperty: (\n received: unknown,\n property: Gtk.AccessibleProperty,\n expected?: AccessibleAttributeValue,\n ) => MatcherResult;\n /** Asserts the widget's checked state is checked rather than unchecked or mixed. */\n toBeChecked: StateMatcher;\n /** Asserts the widget's checked state is mixed. */\n toBePartiallyChecked: StateMatcher;\n /** Asserts a `Gtk.ToggleButton` is active, and throws for any other widget. */\n toBePressed: StateMatcher;\n /** Asserts the widget's accessible pressed state is mixed, and throws when it exposes none. */\n toBePartiallyPressed: StateMatcher;\n /** Asserts the widget is insensitive, or sits inside an insensitive ancestor. */\n toBeDisabled: StateMatcher;\n /** Asserts the widget and all of its ancestors are sensitive. */\n toBeEnabled: StateMatcher;\n /** Asserts the widget and its ancestors are all visible, and that none of them is fully transparent. */\n toBeVisible: StateMatcher;\n /** Asserts the widget's root is a window that is still in the toplevel list. */\n toBeRooted: StateMatcher;\n /** Asserts the widget has neither a child nor label text. */\n toBeEmptyWidget: StateMatcher;\n /** Asserts the widget's accessible invalid state is set to anything other than false. */\n toBeInvalid: StateMatcher;\n /** Asserts the widget's accessible invalid state is unset or false. */\n toBeValid: StateMatcher;\n /** Asserts the widget's accessible required state. */\n toBeRequired: StateMatcher;\n /** Asserts the widget holds the platform focus state. */\n toHaveFocus: StateMatcher;\n /**\n * Asserts a widget's numeric value, or its display value when a string is given.\n *\n * Numbers come from the accessibility tree, which GTK keeps to a resolution of 0.001: it drops an\n * update whose value is nearer than that to the one already published, so a widget that moves by\n * less keeps its previous value. Numbers therefore match within 0.001, the same tolerance the\n * `value` option of the `ByRole` queries and `toHaveAccessibleProperty` apply. That option reads\n * the same tree, where the maximum of a paged widget such as a scrollbar is the last value it can\n * reach, its adjustment's upper bound less one page.\n */\n toHaveValue: (received: unknown, expected?: number | string) => MatcherResult;\n /** Asserts the widget's accessible role. */\n toHaveRole: (received: unknown, expected: Gtk.AccessibleRole) => MatcherResult;\n /** Asserts the widget is, or is an ancestor of, the given widget. */\n toContainElement: (received: unknown, descendant: Gtk.Accessible | null) => MatcherResult;\n /** Asserts the widget comes before the given widget in the widget tree, neither containing the other. */\n toAppearBefore: (received: unknown, other: Gtk.Accessible) => MatcherResult;\n /** Asserts the widget comes after the given widget in the widget tree, neither containing the other. */\n toAppearAfter: (received: unknown, other: Gtk.Accessible) => MatcherResult;\n /** Asserts at least one widget under the received one matches the `ByRole` query. */\n toContainAnyByRole: ContainmentMatcher<RoleQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByRole` query. */\n toContainOneByRole: ContainmentMatcher<RoleQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByText` query. */\n toContainAnyByText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByText` query. */\n toContainOneByText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByLabelText` query. */\n toContainAnyByLabelText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByLabelText` query. */\n toContainOneByLabelText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByPlaceholderText` query. */\n toContainAnyByPlaceholderText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByPlaceholderText` query. */\n toContainOneByPlaceholderText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByDisplayValue` query. */\n toContainAnyByDisplayValue: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByDisplayValue` query. */\n toContainOneByDisplayValue: ContainmentMatcher<TextQueryArgs>;\n /**\n * Asserts the widget carries every given style class, each a name, a space-separated list, or a pattern.\n * Pass `{ exact: true }` last to require exactly that set, which rules out patterns.\n */\n toHaveClass: (received: unknown, ...args: unknown[]) => MatcherResult;\n /**\n * Asserts a GObject property, named as in GObject and looked up by its camel-cased accessor, equals the\n * expected value. With no expected value, asserts the property is set. GObject values compare by identity.\n */\n toHaveObjectProperty: (this: MatcherContext, received: unknown, ...args: unknown[]) => MatcherResult;\n};\n\ntype ExpectExtend = { extend: (m: MatcherImplementations) => void };\n\ntype AttributeExpectation = {\n label: string;\n comparison: string;\n expected: AccessibleAttributeValue;\n actual: AccessibleAttributeValue | null;\n isPass: boolean;\n isReadingRounded: boolean;\n};\n\nconst registration = { isRegistered: false };\nconst MIXED_TRISTATE: number = Gtk.AccessibleTristate.MIXED;\nconst ROUNDED_READING = \", which the accessibility tree rounds to six significant digits\";\nconst displayValueMatcher: TextMatcher = textMatcher(\"toHaveDisplayValue\", getWidgetDisplayValue, \"exact\");\nconst toHaveAccessibleName: TextMatcher = textMatcher(\"toHaveAccessibleName\", getWidgetAccessibleName, \"exact\");\n\nconst toHaveAccessibleDescription: TextMatcher = textMatcher(\n \"toHaveAccessibleDescription\",\n getWidgetDescribedByText,\n \"exact\",\n);\n\nconst toHaveAccessibleErrorMessage: TextMatcher = textMatcher(\n \"toHaveAccessibleErrorMessage\",\n readErrorMessageText,\n \"exact\",\n);\n\nconst toHaveSelection: TextMatcher = textMatcher(\"toHaveSelection\", getWidgetSelection, \"exact\");\nconst toBePressed: StateMatcher = booleanStateMatcher(\"toBePressed\", \"pressed\", getWidgetPressedState);\nconst toBeRequired: StateMatcher = booleanStateMatcher(\"toBeRequired\", \"required\", getWidgetRequiredState);\n\nconst toContainAnyByRole: ContainmentMatcher<RoleQueryArgs> = containmentMatcher(\n \"toContainAnyByRole\",\n false,\n queryAllByRole,\n);\n\nconst toContainOneByRole: ContainmentMatcher<RoleQueryArgs> = containmentMatcher(\n \"toContainOneByRole\",\n true,\n queryAllByRole,\n);\n\nconst toContainAnyByText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByText\",\n false,\n queryAllByText,\n);\n\nconst toContainOneByText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByText\",\n true,\n queryAllByText,\n);\n\nconst toContainAnyByLabelText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByLabelText\",\n false,\n queryAllByLabelText,\n);\n\nconst toContainOneByLabelText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByLabelText\",\n true,\n queryAllByLabelText,\n);\n\nconst toContainAnyByPlaceholderText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByPlaceholderText\",\n false,\n queryAllByPlaceholderText,\n);\n\nconst toContainOneByPlaceholderText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByPlaceholderText\",\n true,\n queryAllByPlaceholderText,\n);\n\nconst toContainAnyByDisplayValue: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByDisplayValue\",\n false,\n queryAllByDisplayValue,\n);\n\nconst toContainOneByDisplayValue: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByDisplayValue\",\n true,\n queryAllByDisplayValue,\n);\n\n/** The widget assertion matchers keyed by name, suitable for passing to `expect.extend`. */\nconst matchers: MatcherImplementations = {\n toHaveDisplayValue,\n toHaveTextContent,\n toHaveAccessibleName,\n toHaveAccessibleDescription,\n toHaveAccessibleErrorMessage,\n toHaveSelection,\n toHaveAccessibleState,\n toHaveAccessibleProperty,\n toBeChecked,\n toBePartiallyChecked,\n toBePressed,\n toBePartiallyPressed,\n toBeDisabled,\n toBeEnabled,\n toBeVisible,\n toBeRooted,\n toBeEmptyWidget,\n toBeInvalid,\n toBeValid,\n toBeRequired,\n toHaveFocus,\n toHaveValue,\n toHaveRole,\n toContainElement,\n toAppearBefore,\n toAppearAfter,\n toContainAnyByRole,\n toContainOneByRole,\n toContainAnyByText,\n toContainOneByText,\n toContainAnyByLabelText,\n toContainOneByLabelText,\n toContainAnyByPlaceholderText,\n toContainOneByPlaceholderText,\n toContainAnyByDisplayValue,\n toContainOneByDisplayValue,\n toHaveClass,\n toHaveObjectProperty,\n};\n\nconst asWidget = (received: unknown, matcherName: string): Gtk.Widget => {\n if (!(received instanceof Gtk.Widget)) {\n throw new TypeError(`${matcherName}: received value must be a Gtk.Widget, got ${typeof received}`);\n }\n\n return received;\n};\n\nconst asObject = (received: unknown, matcherName: string): GObject.Object => {\n if (!(received instanceof GObject.Object)) {\n throw new TypeError(`${matcherName}: received value must be a GObject, got ${typeof received}`);\n }\n\n return received;\n};\n\nconst describeWidget = (widget: Gtk.Widget): string => {\n const role = Gtk.AccessibleRole[widget.getAccessibleRole()];\n const name = getWidgetAccessibleName(widget);\n\n return name === null ? `<${role}>` : `<${role} name=${JSON.stringify(name)}>`;\n};\n\nconst describeObject = (object: GObject.Object): string =>\n object instanceof Gtk.Widget ? describeWidget(object) : `<${getTypeTag(object)}>`;\n\nconst isTextMatch = (actual: string, expected: TextExpectation, mode: \"exact\" | \"substring\"): boolean => {\n if (expected instanceof RegExp) {\n expected.lastIndex = 0;\n\n return expected.test(actual);\n }\n\n return mode === \"exact\" ? actual === expected : actual.includes(expected);\n};\n\nconst describeExpected = (expected: TextExpectation): string =>\n expected instanceof RegExp ? String(expected) : JSON.stringify(expected);\n\nconst negationPrefix = (isPass: boolean): string => (isPass ? \"not \" : \"\");\n\nconst nonEmptyResult = ({ matcherName, widget, actual }: TextMatcherContext): MatcherResult => {\n const isPass = actual !== null && actual !== \"\";\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have a non-empty value for ${matcherName}, ` +\n `but got ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n};\n\nconst matchedResult = (context: TextMatcherContext, expected: TextExpectation, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}${context.matcherName} ${describeExpected(expected)}, ` +\n `but received ${JSON.stringify(context.actual)}\\n${describeWidget(context.widget)}`,\n});\n\nconst stateResult = (widget: Gtk.Widget, stateName: string, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () => `expected widget ${negationPrefix(isPass)}to be ${stateName}\\n${describeWidget(widget)}`,\n});\n\nconst isHoldingFocus = (widget: Gtk.Widget, root: Gtk.Window): boolean => {\n const focus = root.getFocus();\n\n return focus !== null && (focus === widget || focus.isAncestor(widget));\n};\n\nconst isFocusHeldByInactiveWindow = (widget: Gtk.Widget): boolean => {\n const root = widget.getRoot();\n\n return root instanceof Gtk.Window && !isWindowActivated(root) && isHoldingFocus(widget, root);\n};\n\nconst focusResult = (widget: Gtk.Widget, isPass: boolean): MatcherResult => {\n if (isPass || !isFocusHeldByInactiveWindow(widget)) {\n return stateResult(widget, \"focused\", isPass);\n }\n\n return {\n pass: false,\n message: () =>\n \"expected widget to be focused: its window has given it the focus, \" +\n `but that window is not active\\n${describeWidget(widget)}`,\n };\n};\n\nconst describeAttributeValue = (value: AccessibleAttributeValue | null): string =>\n value === null ? \"unset\" : JSON.stringify(value);\n\nconst attributeSetResult = (\n widget: Gtk.Widget,\n label: string,\n actual: AccessibleAttributeValue | null,\n): MatcherResult => {\n const isSet = actual !== null;\n\n return {\n pass: isSet,\n message: () => `expected widget ${negationPrefix(isSet)}to have ${label} set\\n${describeWidget(widget)}`,\n };\n};\n\nconst describeReading = (expectation: AttributeExpectation): string =>\n `${describeAttributeValue(expectation.actual)}${expectation.isReadingRounded ? ROUNDED_READING : \"\"}`;\n\nconst attributeValueResult = (widget: Gtk.Widget, expectation: AttributeExpectation): MatcherResult => ({\n pass: expectation.isPass,\n message: () =>\n `expected widget ${negationPrefix(expectation.isPass)}to have ${expectation.label} ` +\n `${expectation.comparison} ${describeAttributeValue(expectation.expected)}, but received ` +\n `${describeReading(expectation)}\\n${describeWidget(widget)}`,\n});\n\nconst orderResult = (widget: Gtk.Widget, other: Gtk.Widget, position: string, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to appear ${position} ${describeWidget(other)} ` +\n `in the widget tree\\n${describeWidget(widget)}`,\n});\n\nconst getTreeRoot = (widget: Gtk.Widget): Gtk.Widget => {\n let root = widget;\n let parent = root.getParent();\n\n while (parent) {\n root = parent;\n parent = root.getParent();\n }\n\n return root;\n};\n\nconst isSeparateWidget = (first: Gtk.Widget, second: Gtk.Widget): boolean =>\n first !== second && !first.isAncestor(second) && !second.isAncestor(first);\n\nconst isPrecedingWidget = (root: Gtk.Widget, first: Gtk.Widget, second: Gtk.Widget): boolean => {\n for (const widget of descendants(root)) {\n if (widget === first) {\n return true;\n }\n\n if (widget === second) {\n return false;\n }\n }\n\n return false;\n};\n\nconst isAppearingBefore = (first: Gtk.Widget, second: Gtk.Widget): boolean => {\n const root = getTreeRoot(first);\n\n return isSeparateWidget(first, second) && root === getTreeRoot(second) && isPrecedingWidget(root, first, second);\n};\n\nconst isAsymmetricMatcher = (value: unknown): boolean =>\n typeof value === \"object\" && value !== null && typeof Reflect.get(value, \"asymmetricMatch\") === \"function\";\n\nconst isEqualValue = (context: MatcherContext, actual: unknown, expected: unknown): boolean => {\n if (isAsymmetricMatcher(expected)) {\n return context.equals(actual, expected);\n }\n\n if (actual instanceof GObject.Object || expected instanceof GObject.Object) {\n return Object.is(actual, expected);\n }\n\n return context.equals(actual, expected);\n};\n\nconst isClassMatch = (actual: string[], expected: ClassExpectation): boolean =>\n expected instanceof RegExp ? actual.some((name) => expected.test(name)) : actual.includes(expected);\n\nconst isWidgetRooted = (widget: Gtk.Widget): boolean => {\n const root = widget.getRoot();\n\n if (root === null) {\n return false;\n }\n\n if (root instanceof Gtk.Window) {\n return Gtk.Window.listToplevels().includes(root);\n }\n\n return true;\n};\n\nconst globalExpect = (): ExpectExtend | null => {\n const candidate: unknown = Reflect.get(globalThis, \"expect\");\n\n if (candidate && typeof (candidate as ExpectExtend).extend === \"function\") {\n return candidate as ExpectExtend;\n }\n\n return null;\n};\n\nfunction readErrorMessageText(widget: Gtk.Widget): string | null {\n const state = getWidgetInvalidState(widget);\n\n if (state === null || state === Gtk.AccessibleInvalidState.FALSE) {\n return null;\n }\n\n const targets = getWidgetErrorMessage(widget);\n\n if (targets === null) {\n return null;\n }\n\n const texts = targets.map((target) => getWidgetAccessibleName(target)).filter((text) => text !== null);\n\n return texts.length > 0 ? texts.join(\" \") : null;\n}\n\nfunction readObjectProperty(object: GObject.Object, name: string): unknown {\n const value: unknown = Reflect.apply(GObject.getProperty, undefined, [object, name]);\n\n return value;\n}\n\nfunction classEntries(entry: unknown): ClassExpectation[] {\n return entry instanceof RegExp ? [entry] : String(entry).split(/\\s+/).filter(Boolean);\n}\n\nfunction parseClassArguments(args: unknown[]): ClassArguments {\n const last = args.at(-1);\n const isOptions = typeof last === \"object\" && last !== null && !(last instanceof RegExp);\n const isExact = isOptions && Reflect.get(last, \"exact\") === true;\n const entries = isOptions ? args.slice(0, -1) : args;\n\n return { expected: entries.flatMap((entry) => classEntries(entry)), isExact };\n}\n\nfunction exactClassResult(widget: Gtk.Widget, actual: string[], expected: ClassExpectation[]): MatcherResult {\n if (expected.some((entry) => entry instanceof RegExp)) {\n throw new TypeError(\"toHaveClass: the exact option cannot be combined with a regular expression\");\n }\n\n const names = expected.map(String);\n const isPass = names.length === actual.length && names.every((name) => actual.includes(name));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have exactly the classes ${JSON.stringify(names)}, ` +\n `but received ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction textMatcher(\n matcherName: string,\n read: (widget: Gtk.Widget) => string | null,\n mode: \"exact\" | \"substring\",\n): TextMatcher {\n return (received: unknown, expected?: TextExpectation): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const actual = read(widget);\n const context: TextMatcherContext = { matcherName, widget, actual };\n\n if (expected === undefined) {\n return nonEmptyResult(context);\n }\n\n return matchedResult(context, expected, actual !== null && isTextMatch(actual, expected, mode));\n };\n}\n\nfunction normalizeTextContent(text: string, options?: TextContentOptions): string {\n if (options?.normalizeWhitespace === false) {\n return text.replaceAll(\"\\u{A0}\", \" \");\n }\n\n return getDefaultNormalizer()(text);\n}\n\nfunction readTextContent(widget: Gtk.Widget, options?: TextContentOptions): string | null {\n const text = getWidgetTextContent(widget);\n\n return text === null ? null : normalizeTextContent(text, options);\n}\n\nfunction toHaveTextContent(\n received: unknown,\n expected?: TextExpectation,\n options?: TextContentOptions,\n): MatcherResult {\n const read = (widget: Gtk.Widget): string | null => readTextContent(widget, options);\n\n return textMatcher(\"toHaveTextContent\", read, \"substring\")(received, expected);\n}\n\nfunction notApplicable(matcherName: string, stateName: string, widget: Gtk.Widget): Error {\n return new Error(\n `${matcherName}: widget does not expose a ${stateName} ` +\n `(role ${Gtk.AccessibleRole[widget.getAccessibleRole()]})\\n${describeWidget(widget)}`,\n );\n}\n\nfunction booleanStateMatcher(\n matcherName: string,\n stateName: string,\n read: (widget: Gtk.Widget) => boolean | null,\n): StateMatcher {\n return (received: unknown): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const state = read(widget);\n\n if (state === null) {\n throw notApplicable(matcherName, `${stateName} state`, widget);\n }\n\n return stateResult(widget, stateName, state);\n };\n}\n\nfunction containmentMatcher<Args extends unknown[]>(\n matcherName: string,\n isSingle: boolean,\n queryAll: QueryAll<Args>,\n): ContainmentMatcher<Args> {\n const quantity = isSingle ? \"exactly one widget\" : \"any widget\";\n\n return (received: unknown, ...args: Args): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const matches = queryAll(widget, ...args);\n const isPass = isSingle ? matches.length === 1 : matches.length > 0;\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to contain ${quantity} matching ${matcherName}, ` +\n `but found ${String(matches.length)}\\n${describeWidget(widget)}`,\n };\n };\n}\n\nfunction toHaveAccessibleState(\n received: unknown,\n state: Gtk.AccessibleState,\n expected?: boolean | number,\n): MatcherResult {\n const widget = asWidget(received, \"toHaveAccessibleState\");\n const actual = readAccessibleState(widget, state);\n const label = `accessible state ${Gtk.AccessibleState[state]}`;\n\n if (expected === undefined) {\n return attributeSetResult(widget, label, actual);\n }\n\n const wanted = typeof expected === \"boolean\" ? Number(expected) : expected;\n\n return attributeValueResult(widget, {\n label,\n comparison: \"equal to\",\n expected: wanted,\n actual,\n isPass: actual === wanted,\n isReadingRounded: false,\n });\n}\n\nconst propertyLabel = (property: Gtk.AccessibleProperty): string =>\n `accessible property ${Gtk.AccessibleProperty[property]}`;\n\nconst propertyExpectation = (\n widget: Gtk.Widget,\n property: Gtk.AccessibleProperty,\n expected: AccessibleAttributeValue,\n actual: AccessibleAttributeValue | null,\n): AttributeExpectation => {\n const label = propertyLabel(property);\n\n if (typeof expected === \"number\" && isAccessibleNumberProperty(property)) {\n return {\n label,\n comparison: `within ${String(ACCESSIBLE_NUMBER_TOLERANCE)} of`,\n expected,\n actual,\n isPass: isAccessibleNumberMatch(widget, property, expected),\n isReadingRounded: actual !== null,\n };\n }\n\n return { label, comparison: \"equal to\", expected, actual, isPass: actual === expected, isReadingRounded: false };\n};\n\nfunction toHaveAccessibleProperty(\n received: unknown,\n property: Gtk.AccessibleProperty,\n expected?: AccessibleAttributeValue,\n): MatcherResult {\n const widget = asWidget(received, \"toHaveAccessibleProperty\");\n const actual = readAccessibleProperty(widget, property);\n\n if (expected === undefined) {\n return attributeSetResult(widget, propertyLabel(property), actual);\n }\n\n return attributeValueResult(widget, propertyExpectation(widget, property, expected, actual));\n}\n\nfunction toBePartiallyPressed(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBePartiallyPressed\");\n const state = readAccessibleState(widget, Gtk.AccessibleState.PRESSED);\n\n if (state === null) {\n throw notApplicable(\"toBePartiallyPressed\", \"pressed state\", widget);\n }\n\n return stateResult(widget, \"partially pressed\", state === MIXED_TRISTATE);\n}\n\nfunction toAppearBefore(received: unknown, other: Gtk.Accessible): MatcherResult {\n const widget = asWidget(received, \"toAppearBefore\");\n const target = asWidget(other, \"toAppearBefore\");\n\n return orderResult(widget, target, \"before\", isAppearingBefore(widget, target));\n}\n\nfunction toAppearAfter(received: unknown, other: Gtk.Accessible): MatcherResult {\n const widget = asWidget(received, \"toAppearAfter\");\n const target = asWidget(other, \"toAppearAfter\");\n\n return orderResult(widget, target, \"after\", isAppearingBefore(target, widget));\n}\n\nfunction readCheckedState(widget: Gtk.Widget, matcherName: string): CheckedState {\n const state = getWidgetCheckedState(widget);\n\n if (state === null) {\n throw notApplicable(matcherName, \"checked state\", widget);\n }\n\n return state;\n}\n\nfunction toBeChecked(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeChecked\");\n\n return stateResult(widget, \"checked\", readCheckedState(widget, \"toBeChecked\") === \"checked\");\n}\n\nfunction toBePartiallyChecked(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBePartiallyChecked\");\n\n return stateResult(widget, \"partially checked\", readCheckedState(widget, \"toBePartiallyChecked\") === \"mixed\");\n}\n\nfunction toHaveDisplayValue(received: unknown, expected?: TextExpectation): MatcherResult {\n const widget = asWidget(received, \"toHaveDisplayValue\");\n\n if (!hasDisplayValue(widget)) {\n throw notApplicable(\"toHaveDisplayValue\", \"display value\", widget);\n }\n\n return displayValueMatcher(received, expected);\n}\n\nconst describeValueExpectation = (expected: number | undefined): string =>\n expected === undefined ? \"set\" : `within ${String(ACCESSIBLE_NUMBER_TOLERANCE)} of ${String(expected)}`;\n\nfunction toHaveValue(received: unknown, expected?: number | string): MatcherResult {\n const widget = asWidget(received, \"toHaveValue\");\n\n if (typeof expected === \"string\") {\n return displayValueMatcher(received, expected);\n }\n\n const actual = getWidgetValueNow(widget);\n\n if (actual === null) {\n throw notApplicable(\"toHaveValue\", \"numeric value\", widget);\n }\n\n const isPass = expected === undefined || isWidgetValueMatch(widget, \"now\", expected);\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have value ${describeValueExpectation(expected)}, ` +\n `but received ${String(actual)}${ROUNDED_READING}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toBeDisabled(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeDisabled\");\n\n return stateResult(widget, \"disabled\", isWidgetDisabled(widget));\n}\n\nfunction toBeEnabled(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeEnabled\");\n\n return stateResult(widget, \"enabled\", !isWidgetDisabled(widget));\n}\n\nfunction toBeVisible(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeVisible\");\n\n return stateResult(widget, \"visible\", isWidgetVisible(widget));\n}\n\nfunction toBeRooted(received: unknown): MatcherResult {\n if (received === null) {\n return { pass: false, message: () => \"expected a widget to be rooted in a window, but received null\" };\n }\n\n const widget = asWidget(received, \"toBeRooted\");\n\n return stateResult(widget, \"rooted in a window\", isWidgetRooted(widget));\n}\n\nfunction toBeEmptyWidget(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeEmptyWidget\");\n\n return stateResult(widget, \"empty\", widget.getFirstChild() === null && getWidgetLabelText(widget) === null);\n}\n\nfunction toBeInvalid(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeInvalid\");\n const state = getWidgetInvalidState(widget);\n\n return stateResult(widget, \"invalid\", state !== null && state !== Gtk.AccessibleInvalidState.FALSE);\n}\n\nfunction toBeValid(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeValid\");\n const state = getWidgetInvalidState(widget);\n\n return stateResult(widget, \"valid\", state === null || state === Gtk.AccessibleInvalidState.FALSE);\n}\n\nfunction toHaveFocus(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toHaveFocus\");\n\n return focusResult(widget, widget.getPlatformState(Gtk.AccessiblePlatformState.FOCUSED));\n}\n\nfunction toHaveRole(received: unknown, expected: Gtk.AccessibleRole): MatcherResult {\n const widget = asWidget(received, \"toHaveRole\");\n const actual = widget.getAccessibleRole();\n const isPass = actual === expected;\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have role '${formatRole(expected)}', ` +\n `but received '${formatRole(actual)}'\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toContainElement(received: unknown, descendant: Gtk.Accessible | null): MatcherResult {\n const widget = asWidget(received, \"toContainElement\");\n const target = descendant === null ? null : asWidget(descendant, \"toContainElement\");\n const isPass = target !== null && (target === widget || target.isAncestor(widget));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to contain ` +\n `${target === null ? \"null\" : describeWidget(target)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toHaveClass(received: unknown, ...args: unknown[]): MatcherResult {\n const widget = asWidget(received, \"toHaveClass\");\n const actual = widget.getCssClasses();\n const { expected, isExact } = parseClassArguments(args);\n\n if (isExact) {\n return exactClassResult(widget, actual, expected);\n }\n\n if (expected.length === 0) {\n return stateResult(widget, \"given any style class\", actual.length > 0);\n }\n\n const isPass = expected.every((entry) => isClassMatch(actual, entry));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have class ${expected.map(String).join(\", \")}, ` +\n `but received ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toHaveObjectProperty(this: MatcherContext, received: unknown, ...args: unknown[]): MatcherResult {\n const object = asObject(received, \"toHaveObjectProperty\");\n const [name, expected] = args;\n const actual = readObjectProperty(object, String(name));\n\n if (args.length < 2) {\n const isSet = actual !== null && actual !== undefined;\n\n return {\n pass: isSet,\n message: () =>\n `expected ${describeObject(object)} ${negationPrefix(isSet)}to have a value for property ` +\n `\"${String(name)}\", but received ${JSON.stringify(actual)}`,\n };\n }\n\n const isPass = isEqualValue(this, actual, expected);\n\n return {\n pass: isPass,\n message: () =>\n `expected ${describeObject(object)} ${negationPrefix(isPass)}to have property \"${String(name)}\" ` +\n `equal to ${JSON.stringify(expected)}, but received ${JSON.stringify(actual)}`,\n };\n}\n\n/** Registers the widget matchers on the global `expect`, when one is available. Safe to call more than once. */\nconst registerMatchers = (): void => {\n if (registration.isRegistered) {\n return;\n }\n\n const expect = globalExpect();\n\n if (!expect) {\n return;\n }\n\n expect.extend(matchers);\n registration.isRegistered = true;\n};\n\ndeclare module \"vitest\" {\n /* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars --\n declaration merging requires an interface with vitest's exact type parameters */\n interface Matchers<R extends void | Promise<void> = void | Promise<void>, T = unknown> {\n toHaveDisplayValue(expected?: TextExpectation): R;\n toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): R;\n toHaveAccessibleName(expected?: TextExpectation): R;\n toHaveAccessibleDescription(expected?: TextExpectation): R;\n toHaveAccessibleErrorMessage(expected?: TextExpectation): R;\n toHaveSelection(expected?: TextExpectation): R;\n /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */\n toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): R;\n toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): R;\n toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): R;\n toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): R;\n /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */\n toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): R;\n toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): R;\n toHaveAccessibleProperty(\n property: Gtk.AccessibleProperty.AUTOCOMPLETE,\n expected?: Gtk.AccessibleAutocomplete,\n ): R;\n toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): R;\n toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): R;\n toBeChecked(): R;\n toBePartiallyChecked(): R;\n toBePressed(): R;\n toBePartiallyPressed(): R;\n toBeDisabled(): R;\n toBeEnabled(): R;\n toBeVisible(): R;\n toBeRooted(): R;\n toBeEmptyWidget(): R;\n toBeInvalid(): R;\n toBeValid(): R;\n toBeRequired(): R;\n toHaveFocus(): R;\n toHaveValue(expected?: number | string): R;\n toHaveRole(expected: Gtk.AccessibleRole): R;\n toContainElement(descendant: Gtk.Accessible | null): R;\n toAppearBefore(other: Gtk.Accessible): R;\n toAppearAfter(other: Gtk.Accessible): R;\n toContainAnyByRole(...args: RoleQueryArgs): R;\n toContainOneByRole(...args: RoleQueryArgs): R;\n toContainAnyByText(...args: TextQueryArgs): R;\n toContainOneByText(...args: TextQueryArgs): R;\n toContainAnyByLabelText(...args: TextQueryArgs): R;\n toContainOneByLabelText(...args: TextQueryArgs): R;\n toContainAnyByPlaceholderText(...args: TextQueryArgs): R;\n toContainOneByPlaceholderText(...args: TextQueryArgs): R;\n toContainAnyByDisplayValue(...args: TextQueryArgs): R;\n toContainOneByDisplayValue(...args: TextQueryArgs): R;\n toHaveClass(...args: (ClassExpectation | { exact: boolean })[]): R;\n toHaveObjectProperty(name: string, expected?: unknown): R;\n }\n /* eslint-enable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars */\n}\n\nexport { matchers, registerMatchers, type ClassExpectation, type TextContentOptions, type TextExpectation };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EACH,oBAAoB,EACpB,aAAa,EAEb,yBAAyB,EACzB,gBAAgB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkC,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,SAAS,EAA4B,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAkB,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,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ACvB,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import type { RootElement } from \"@gtkx/react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport {\n createReconcilerRoot,\n isRootElement,\n type ReconcilerRoot,\n setReconcilerErrorHandler,\n settleAccessible,\n} from \"@gtkx/react/internal\";\nimport { type ErrorInfo, type ReactNode, StrictMode } from \"react\";\nimport type { RenderResult } from \"./bound-queries.js\";\nimport type { QueryMap, RenderOptions, ScreenshotOptions } from \"./types.js\";\nimport { runInAct, runWithActEnvironment } from \"./act.js\";\nimport { addToCleanupQueue, runCleanup } from \"./cleanup-registry.js\";\nimport { getConfig } from \"./config.js\";\nimport { scheduleWhenWindowReady } from \"./frame-sync.js\";\nimport { createHarnessWindow, presentHarnessWindow } from \"./harness-window.js\";\nimport { logWidget, type PrettyWidgetOptions } from \"./pretty-widget.js\";\nimport { logRoles } from \"./role-helpers.js\";\nimport { clearScreen, setScreen } from \"./screen.js\";\nimport { captureScreen } from \"./screenshot.js\";\nimport { type Container, roots, TOPLEVELS } from \"./traversal.js\";\nimport { resetClipboard } from \"./user-event/index.js\";\nimport { requireWidget } from \"./widget-target.js\";\nimport { findPresentedWindowFailure, findRenderedWindowFailure, mappedToplevels } from \"./window-state.js\";\nimport { within } from \"./within.js\";\n\n/** A mounted render tracked so cleanup can unmount it. */\ntype ActiveRender = {\n /** Root that rerenders drive and that cleanup tears the tree down through. */\n root: ReconcilerRoot;\n /** Harness window created for the render, null when it renders into a container the caller supplied. */\n window: Gtk.Window | null;\n};\n\ntype ResolvedContainer = {\n containerInfo: Gtk.Widget | RootElement;\n window: Gtk.Window | null;\n};\n\ntype ReconcilerErrorState = {\n lastError: Error | null;\n isHandlerInstalled: boolean;\n};\n\ntype WindowFailureReporter = (window: Gtk.Window) => string | null;\ntype SettleAction = \"render\" | \"rerender\";\n\nconst reconcilerErrors: ReconcilerErrorState = { lastError: null, isHandlerInstalled: false };\nconst activeRenders: Set<ActiveRender> = new Set();\n\nconst settleWindow = async (\n window: Gtk.Window | null,\n findFailure: WindowFailureReporter,\n action: SettleAction,\n): Promise<void> => {\n const timeout = getConfig().windowActivationTimeout;\n\n await runWithActEnvironment(\n false,\n () =>\n new Promise<void>((resolve) => {\n scheduleWhenWindowReady(window, (target) => findFailure(target) === null, timeout, resolve);\n }),\n );\n\n settleAccessible();\n const failure = window === null ? null : findFailure(window);\n\n if (failure !== null) {\n throw new Error(\n `${action} timed out after ${String(timeout)}ms waiting for the window it rendered into: ${failure}. ` +\n \"Platform state such as focus is only readable once that window is allocated and active.\",\n );\n }\n};\n\nconst update = async (element: ReactNode, root: ReconcilerRoot): Promise<void> => {\n await runInAct(() => {\n root.update(element);\n });\n\n if (reconcilerErrors.lastError) {\n const captured = reconcilerErrors.lastError;\n reconcilerErrors.lastError = null;\n throw captured;\n }\n};\n\nconst disposeActiveRender = async (active: ActiveRender): Promise<void> => {\n if (!activeRenders.delete(active)) {\n return;\n }\n\n await active.root.unmount(async (root) => {\n await update(null, root);\n active.window?.destroy();\n });\n};\n\nconst disposeAllActiveRenders = async (): Promise<void> => {\n for (const active of activeRenders) {\n await disposeActiveRender(active);\n }\n};\n\nconst handleError = (error: unknown): void => {\n reconcilerErrors.lastError = error instanceof Error ? error : new Error(String(error));\n};\n\nconst installErrorHandler = (): void => {\n if (reconcilerErrors.isHandlerInstalled) {\n return;\n }\n\n setReconcilerErrorHandler(handleError);\n reconcilerErrors.isHandlerInstalled = true;\n};\n\nconst resolveContainer = (container: RenderOptions[\"container\"]): ResolvedContainer => {\n if (isRootElement(container)) {\n return { containerInfo: container, window: null };\n }\n\n if (container instanceof Gtk.Widget) {\n return { containerInfo: container, window: null };\n }\n\n if (container !== undefined) {\n requireWidget(container);\n }\n\n const window = createHarnessWindow();\n window.setDecorated(false);\n\n return { containerInfo: window, window };\n};\n\nconst firstToplevelWidget = (baseElement: Container): Gtk.Widget => {\n if (baseElement instanceof Gtk.Widget) {\n return baseElement;\n }\n\n const [first] = roots(baseElement);\n\n if (first) {\n return first;\n }\n\n throw new Error(\"render() produced no widgets: ensure the element renders visible content\");\n};\n\nconst resolveResultContainer = (\n resolved: ResolvedContainer,\n container: RenderOptions[\"container\"],\n baseElement: Container,\n): Gtk.Widget => {\n if (resolved.window) {\n return resolved.window;\n }\n\n if (container instanceof Gtk.Widget) {\n return container;\n }\n\n return firstToplevelWidget(baseElement);\n};\n\nconst realizedWindow = (root: Gtk.Root | null): Gtk.Window | null =>\n root instanceof Gtk.Window && root.getFrameClock() !== null ? root : null;\n\nconst settleTarget = (resolved: ResolvedContainer, container: RenderOptions[\"container\"]): Gtk.Window | null => {\n if (resolved.window) {\n return realizedWindow(resolved.window);\n }\n\n if (container instanceof Gtk.Widget) {\n return realizedWindow(container.getRoot());\n }\n\n return realizedWindow(mappedToplevels()[0] ?? null);\n};\n\nconst settleRender = async (\n resolved: ResolvedContainer,\n container: RenderOptions[\"container\"],\n action: SettleAction,\n): Promise<void> => {\n const isPresentedNow = action === \"render\" && resolved.window !== null;\n const findFailure = isPresentedNow ? findPresentedWindowFailure : findRenderedWindowFailure;\n await settleWindow(settleTarget(resolved, container), findFailure, action);\n};\n\nconst renderErrorHandlers = <Q extends QueryMap>(options: RenderOptions<Q> | undefined) => ({\n onUncaughtError: handleError,\n onCaughtError: (error: unknown, errorInfo: ErrorInfo): void => {\n handleError(error);\n options?.onCaughtError?.(error, errorInfo);\n },\n onRecoverableError: (error: unknown, errorInfo: ErrorInfo): void => {\n options?.onRecoverableError?.(error, errorInfo);\n },\n});\n\nconst applyEnableAnimations = (areAnimationsEnabled: boolean): void => {\n const settings = Gtk.Settings.getDefault();\n\n if (settings) {\n settings.gtkEnableAnimations = areAnimationsEnabled;\n }\n};\n\n/**\n * Renders a React element into a GTK4 widget tree and returns queries\n * scoped to it along with controls for rerendering and unmounting. When no\n * container is supplied, a harness window is created and presented, and the editable it hands the\n * focus to keeps its text unselected, with its caret at the end. The returned promise settles once\n * the window the tree is shown in has been laid out and activation has arrived, so platform state\n * such as focus is already readable when it resolves. A presented harness window is waited on until\n * it is itself active; a window the caller or the tree owns is waited on until the application holds\n * activation, since only a present can claim it. Rendering into a container that is not shown waits\n * for nothing, and a window that never becomes readable within `windowActivationTimeout` throws an\n * error naming the condition that failed rather than resolving with unreadable platform state. A\n * tree mounted into a container that sits outside every toplevel, or inside a window that is not\n * visible, is out of reach of a pointer and a keyboard, so every `userEvent` helper aimed at it\n * rejects after `actionabilityTimeout` naming that condition, and `fireEvent` drives it instead.\n *\n * @param element The React element to render.\n * @param options Optional container, wrapper, custom queries, and other render settings.\n * @returns A render result with bound queries, debug helpers, and lifecycle controls.\n * @throws When the window the tree is shown in is not laid out and activated in time.\n */\nconst render = async <Q extends QueryMap = Record<never, never>>(\n element: ReactNode,\n options?: RenderOptions<Q>,\n): Promise<RenderResult<Q>> => {\n installErrorHandler();\n applyEnableAnimations(options?.areAnimationsEnabled === true);\n const baseElement: Container = options?.baseElement ?? TOPLEVELS;\n const Wrapper = options?.wrapper;\n const resolved = resolveContainer(options?.container);\n\n const root = createReconcilerRoot({\n containerInfo: resolved.containerInfo,\n ...renderErrorHandlers(options),\n });\n\n const active: ActiveRender = { root, window: resolved.window };\n activeRenders.add(active);\n addToCleanupQueue(disposeAllActiveRenders);\n addToCleanupQueue(clearScreen);\n addToCleanupQueue(resetClipboard);\n\n const wrap = (node: ReactNode): ReactNode => {\n const wrapped = Wrapper ? <Wrapper>{node}</Wrapper> : node;\n\n return options?.isReactStrictMode ? <StrictMode>{wrapped}</StrictMode> : wrapped;\n };\n\n await update(wrap(element), root);\n presentHarnessWindow(resolved.window);\n await settleRender(resolved, options?.container, \"render\");\n const container = resolveResultContainer(resolved, options?.container, baseElement);\n\n const result: RenderResult<Q> = {\n ...within(baseElement, options?.queries),\n container,\n baseElement,\n unmount: async () => {\n await disposeActiveRender(active);\n },\n rerender: async (newElement: ReactNode) => {\n await update(wrap(newElement), root);\n await settleRender(resolved, options?.container, \"rerender\");\n },\n debug: (element: Container | Container[] = baseElement, debugOptions?: PrettyWidgetOptions) => {\n logWidget(element, debugOptions);\n },\n logRoles: () => {\n logRoles(baseElement);\n },\n screenshot: (screenshotOptions?: ScreenshotOptions) => captureScreen(screenshotOptions),\n };\n\n setScreen(result);\n\n return result;\n};\n\n/**\n * Unmounts every active render and runs all registered cleanup callbacks,\n * resetting the screen and clipboard. Called automatically after each test.\n */\nconst cleanup = async (): Promise<void> => {\n await runCleanup();\n};\n\nexport { render, cleanup };\n"]}
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EACH,oBAAoB,EACpB,aAAa,EAEb,yBAAyB,EACzB,gBAAgB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkC,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnE,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,SAAS,EAA4B,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAkB,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM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AAG,KAAK,IAAmB,EAAE;IACtC,MAAM,UAAU,EAAE,CAAC;AACvB,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import type { CaughtErrorInfo, RootElement } from \"@gtkx/react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport {\n createReconcilerRoot,\n isRootElement,\n type ReconcilerRoot,\n setReconcilerErrorHandler,\n settleAccessible,\n} from \"@gtkx/react/internal\";\nimport { type ErrorInfo, type ReactNode, StrictMode } from \"react\";\nimport type { RenderResult } from \"./bound-queries.js\";\nimport type { QueryMap, RenderOptions, ScreenshotOptions } from \"./types.js\";\nimport { runInAct, runWithActEnvironment } from \"./act.js\";\nimport { addToCleanupQueue, runCleanup } from \"./cleanup-registry.js\";\nimport { getConfig } from \"./config.js\";\nimport { scheduleWhenWindowReady } from \"./frame-sync.js\";\nimport { createHarnessWindow, presentHarnessWindow } from \"./harness-window.js\";\nimport { logWidget, type PrettyWidgetOptions } from \"./pretty-widget.js\";\nimport { logRoles } from \"./role-helpers.js\";\nimport { clearScreen, setScreen } from \"./screen.js\";\nimport { captureScreen } from \"./screenshot.js\";\nimport { type Container, roots, TOPLEVELS } from \"./traversal.js\";\nimport { resetClipboard } from \"./user-event/index.js\";\nimport { requireWidget } from \"./widget-target.js\";\nimport { findPresentedWindowFailure, findRenderedWindowFailure, mappedToplevels } from \"./window-state.js\";\nimport { within } from \"./within.js\";\n\n/** A mounted render tracked so cleanup can unmount it. */\ntype ActiveRender = {\n /** Root that rerenders drive and that cleanup tears the tree down through. */\n root: ReconcilerRoot;\n /** Harness window created for the render, null when it renders into a container the caller supplied. */\n window: Gtk.Window | null;\n};\n\ntype ResolvedContainer = {\n containerInfo: Gtk.Widget | RootElement;\n window: Gtk.Window | null;\n};\n\ntype ReconcilerErrorState = {\n lastError: Error | null;\n isHandlerInstalled: boolean;\n};\n\ntype WindowFailureReporter = (window: Gtk.Window) => string | null;\ntype SettleAction = \"render\" | \"rerender\";\n\nconst reconcilerErrors: ReconcilerErrorState = { lastError: null, isHandlerInstalled: false };\nconst activeRenders: Set<ActiveRender> = new Set();\n\nconst settleWindow = async (\n window: Gtk.Window | null,\n findFailure: WindowFailureReporter,\n action: SettleAction,\n): Promise<void> => {\n const timeout = getConfig().windowActivationTimeout;\n\n await runWithActEnvironment(\n false,\n () =>\n new Promise<void>((resolve) => {\n scheduleWhenWindowReady(window, (target) => findFailure(target) === null, timeout, resolve);\n }),\n );\n\n settleAccessible();\n const failure = window === null ? null : findFailure(window);\n\n if (failure !== null) {\n throw new Error(\n `${action} timed out after ${String(timeout)}ms waiting for the window it rendered into: ${failure}. ` +\n \"Platform state such as focus is only readable once that window is allocated and active.\",\n );\n }\n};\n\nconst update = async (element: ReactNode, root: ReconcilerRoot): Promise<void> => {\n await runInAct(() => {\n root.update(element);\n });\n\n if (reconcilerErrors.lastError) {\n const captured = reconcilerErrors.lastError;\n reconcilerErrors.lastError = null;\n throw captured;\n }\n};\n\nconst disposeActiveRender = async (active: ActiveRender): Promise<void> => {\n if (!activeRenders.delete(active)) {\n return;\n }\n\n await active.root.unmount(async (root) => {\n await update(null, root);\n active.window?.destroy();\n });\n};\n\nconst disposeAllActiveRenders = async (): Promise<void> => {\n for (const active of activeRenders) {\n await disposeActiveRender(active);\n }\n};\n\nconst handleError = (error: unknown): void => {\n reconcilerErrors.lastError = error instanceof Error ? error : new Error(String(error));\n};\n\nconst installErrorHandler = (): void => {\n if (reconcilerErrors.isHandlerInstalled) {\n return;\n }\n\n setReconcilerErrorHandler(handleError);\n reconcilerErrors.isHandlerInstalled = true;\n};\n\nconst resolveContainer = (container: RenderOptions[\"container\"]): ResolvedContainer => {\n if (isRootElement(container)) {\n return { containerInfo: container, window: null };\n }\n\n if (container instanceof Gtk.Widget) {\n return { containerInfo: container, window: null };\n }\n\n if (container !== undefined) {\n requireWidget(container);\n }\n\n const window = createHarnessWindow();\n window.setDecorated(false);\n\n return { containerInfo: window, window };\n};\n\nconst firstToplevelWidget = (baseElement: Container): Gtk.Widget => {\n if (baseElement instanceof Gtk.Widget) {\n return baseElement;\n }\n\n const [first] = roots(baseElement);\n\n if (first) {\n return first;\n }\n\n throw new Error(\"render() produced no widgets: ensure the element renders visible content\");\n};\n\nconst resolveResultContainer = (\n resolved: ResolvedContainer,\n container: RenderOptions[\"container\"],\n baseElement: Container,\n): Gtk.Widget => {\n if (resolved.window) {\n return resolved.window;\n }\n\n if (container instanceof Gtk.Widget) {\n return container;\n }\n\n return firstToplevelWidget(baseElement);\n};\n\nconst realizedWindow = (root: Gtk.Root | null): Gtk.Window | null =>\n root instanceof Gtk.Window && root.getFrameClock() !== null ? root : null;\n\nconst settleTarget = (resolved: ResolvedContainer, container: RenderOptions[\"container\"]): Gtk.Window | null => {\n if (resolved.window) {\n return realizedWindow(resolved.window);\n }\n\n if (container instanceof Gtk.Widget) {\n return realizedWindow(container.getRoot());\n }\n\n return realizedWindow(mappedToplevels()[0] ?? null);\n};\n\nconst settleRender = async (\n resolved: ResolvedContainer,\n container: RenderOptions[\"container\"],\n action: SettleAction,\n): Promise<void> => {\n const isPresentedNow = action === \"render\" && resolved.window !== null;\n const findFailure = isPresentedNow ? findPresentedWindowFailure : findRenderedWindowFailure;\n await settleWindow(settleTarget(resolved, container), findFailure, action);\n};\n\nconst renderErrorHandlers = <Q extends QueryMap>(options: RenderOptions<Q> | undefined) => ({\n onUncaughtError: handleError,\n onCaughtError: (error: unknown, errorInfo: CaughtErrorInfo): void => {\n handleError(error);\n options?.onCaughtError?.(error, errorInfo);\n },\n onRecoverableError: (error: unknown, errorInfo: ErrorInfo): void => {\n options?.onRecoverableError?.(error, errorInfo);\n },\n});\n\nconst applyEnableAnimations = (areAnimationsEnabled: boolean): void => {\n const settings = Gtk.Settings.getDefault();\n\n if (settings) {\n settings.gtkEnableAnimations = areAnimationsEnabled;\n }\n};\n\n/**\n * Renders a React element into a GTK4 widget tree and returns queries\n * scoped to it along with controls for rerendering and unmounting. When no\n * container is supplied, a harness window is created and presented, and the editable it hands the\n * focus to keeps its text unselected, with its caret at the end. The returned promise settles once\n * the window the tree is shown in has been laid out and activation has arrived, so platform state\n * such as focus is already readable when it resolves. A presented harness window is waited on until\n * it is itself active; a window the caller or the tree owns is waited on until the application holds\n * activation, since only a present can claim it. Rendering into a container that is not shown waits\n * for nothing, and a window that never becomes readable within `windowActivationTimeout` throws an\n * error naming the condition that failed rather than resolving with unreadable platform state. A\n * tree mounted into a container that sits outside every toplevel, or inside a window that is not\n * visible, is out of reach of a pointer and a keyboard, so every `userEvent` helper aimed at it\n * rejects after `actionabilityTimeout` naming that condition, and `fireEvent` drives it instead.\n *\n * @param element The React element to render.\n * @param options Optional container, wrapper, custom queries, and other render settings.\n * @returns A render result with bound queries, debug helpers, and lifecycle controls.\n * @throws When the window the tree is shown in is not laid out and activated in time.\n */\nconst render = async <Q extends QueryMap = Record<never, never>>(\n element: ReactNode,\n options?: RenderOptions<Q>,\n): Promise<RenderResult<Q>> => {\n installErrorHandler();\n applyEnableAnimations(options?.areAnimationsEnabled === true);\n const baseElement: Container = options?.baseElement ?? TOPLEVELS;\n const Wrapper = options?.wrapper;\n const resolved = resolveContainer(options?.container);\n\n const root = createReconcilerRoot({\n containerInfo: resolved.containerInfo,\n ...renderErrorHandlers(options),\n });\n\n const active: ActiveRender = { root, window: resolved.window };\n activeRenders.add(active);\n addToCleanupQueue(disposeAllActiveRenders);\n addToCleanupQueue(clearScreen);\n addToCleanupQueue(resetClipboard);\n\n const wrap = (node: ReactNode): ReactNode => {\n const wrapped = Wrapper ? <Wrapper>{node}</Wrapper> : node;\n\n return options?.isReactStrictMode ? <StrictMode>{wrapped}</StrictMode> : wrapped;\n };\n\n await update(wrap(element), root);\n presentHarnessWindow(resolved.window);\n await settleRender(resolved, options?.container, \"render\");\n const container = resolveResultContainer(resolved, options?.container, baseElement);\n\n const result: RenderResult<Q> = {\n ...within(baseElement, options?.queries),\n container,\n baseElement,\n unmount: async () => {\n await disposeActiveRender(active);\n },\n rerender: async (newElement: ReactNode) => {\n await update(wrap(newElement), root);\n await settleRender(resolved, options?.container, \"rerender\");\n },\n debug: (element: Container | Container[] = baseElement, debugOptions?: PrettyWidgetOptions) => {\n logWidget(element, debugOptions);\n },\n logRoles: () => {\n logRoles(baseElement);\n },\n screenshot: (screenshotOptions?: ScreenshotOptions) => captureScreen(screenshotOptions),\n };\n\n setScreen(result);\n\n return result;\n};\n\n/**\n * Unmounts every active render and runs all registered cleanup callbacks,\n * resetting the screen and clipboard. Called automatically after each test.\n */\nconst cleanup = async (): Promise<void> => {\n await runCleanup();\n};\n\nexport { render, cleanup };\n"]}
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type * as Gtk from "@gtkx/gi/gtk";
2
- import type { RootElement } from "@gtkx/react";
2
+ import type { CaughtErrorInfo, RootElement } from "@gtkx/react";
3
3
  import type { ComponentType, ErrorInfo, ReactNode } from "react";
4
4
  import type { PrettyWidgetOptions } from "./pretty-widget.js";
5
5
  import type { Container } from "./traversal.js";
@@ -156,7 +156,7 @@ type RenderOptions<Q extends QueryMap = Record<never, never>> = {
156
156
  /** Enable widget animations during the test. */
157
157
  areAnimationsEnabled?: boolean | undefined;
158
158
  /** Called for errors caught by React error boundaries. */
159
- onCaughtError?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined;
159
+ onCaughtError?: ((error: unknown, errorInfo: CaughtErrorInfo) => void) | undefined;
160
160
  /** Called for errors React recovered from automatically. */
161
161
  onRecoverableError?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined;
162
162
  /** Custom queries to bind to the rendered result. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EA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types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA0QA,OAAO,EAoBN,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { RootElement } from \"@gtkx/react\";\nimport type { ComponentType, ErrorInfo, ReactNode } from \"react\";\nimport type { PrettyWidgetOptions } from \"./pretty-widget.js\";\nimport type { Container } from \"./traversal.js\";\n\n/**\n * A custom matcher predicate: given a candidate widget's normalized text content and the widget\n * itself, returns whether it matches.\n */\ntype MatcherFunction = (content: string, widget: Gtk.Widget) => boolean;\n/** A value used to match widget text: a string or number, a regular expression, or a custom {@link MatcherFunction}. */\ntype Matcher = string | number | RegExp | MatcherFunction;\n/** Normalizes a widget's text before it is compared against a matcher. */\ntype NormalizerFn = (text: string) => string;\n/**\n * A widget class usable as a query's `as` constraint, such as `Gtk.Button`. Abstract classes and\n * generated GInterface pseudo-classes that extend `Gtk.Accessible` are accepted.\n */\ntype WidgetType<T extends Gtk.Accessible = Gtk.Accessible> = abstract new (\n ...args: never[]\n) => T;\n\n/** Options controlling the default text normalizer. */\ntype NormalizerOptions = {\n /** Trim leading and trailing whitespace. */\n trim?: boolean | undefined;\n /** Collapse runs of whitespace into a single space. */\n collapseWhitespace?: boolean | undefined;\n};\n\n/** Options controlling how asynchronous queries and waits poll for a condition. */\ntype WaitForOptions = {\n /** Maximum time in milliseconds to keep retrying before failing. */\n timeout?: number | undefined;\n /** Delay in milliseconds between retries. */\n interval?: number | undefined;\n /** Transforms the error thrown when the timeout elapses. */\n onTimeout?: ((error: Error) => Error) | undefined;\n /** Error whose stack trace attributes the timeout failure to the calling code. */\n stackTraceError?: Error | undefined;\n};\n\n/** Options controlling text matching and, for asynchronous queries, polling behavior. */\ntype MatcherOptions<T extends Gtk.Accessible = Gtk.Accessible> = {\n /** When true (the default), require an exact match; when false, match case-insensitively as a substring. */\n exact?: boolean | undefined;\n /** Custom normalizer replacing the default; cannot be combined with `trim` or `collapseWhitespace`. */\n normalizer?: NormalizerFn | undefined;\n /** Forwarded to the default normalizer when no custom `normalizer` is given. */\n trim?: boolean | undefined;\n /** Forwarded to the default normalizer when no custom `normalizer` is given. */\n collapseWhitespace?: boolean | undefined;\n /** Whether to include a suggested better query in error messages. */\n suggest?: boolean | undefined;\n /** Restricts matches to instances of this widget class, and narrows the query's return type to it. */\n as?: WidgetType<T> | undefined;\n} & WaitForOptions;\n\n/**\n * Constraints on a widget's numeric range value used by role queries. The numbers come from the\n * accessibility tree and match within 0.001, the resolution GTK keeps them to.\n */\ntype ByRoleValue = {\n /** The current value. */\n now?: number | undefined;\n /** The lower bound of the value's range. */\n min?: number | undefined;\n /**\n * The highest value the widget can reach, which on a paged widget such as a scrollbar is its\n * adjustment's upper bound less one page.\n */\n max?: number | undefined;\n /** Matcher for the value's textual representation. */\n text?: Matcher | undefined;\n};\n\n/** Options for role queries: an accessible name matcher plus accessible state and value constraints. */\ntype ByRoleOptions<T extends Gtk.Accessible = Gtk.Accessible> = MatcherOptions<T> & {\n /** Matcher for the widget's accessible name. */\n name?: Matcher | undefined;\n /** Required checked state; a mixed check button reads as neither, so it matches neither value. */\n checked?: boolean | undefined;\n /** Required active state of a toggle button; any other widget matches neither value. */\n pressed?: boolean | undefined;\n /** Required selected state of a row, list item, grid cell, option or tree item. */\n selected?: boolean | undefined;\n /** Required expanded state of an expander or tree expander. */\n expanded?: boolean | undefined;\n /** Heading or hierarchy level. */\n level?: number | undefined;\n /** Required busy state, which an unset state satisfies as false. */\n busy?: boolean | undefined;\n /** Matcher for the widget's own accessible description, ignoring its `described-by` targets. */\n description?: Matcher | undefined;\n /** Constraints on the widget's range value, each checked only when given. */\n value?: ByRoleValue | undefined;\n /** When true, include widgets excluded from the accessibility tree. Widgets that are not mapped stay excluded. */\n hidden?: boolean | undefined;\n};\n\n/** A React component that wraps rendered content, receiving it as its children. */\ntype WrapperComponent = ComponentType<{\n children: ReactNode;\n}>;\n\n/** A custom query, taking the scope to search as its first argument and its matcher arguments after it. */\ntype Query = (container: Container, ...args: never[]) => unknown;\n/** Custom queries keyed by the name each is bound under. */\ntype QueryMap = Record<string, Query>;\n\n/** A query with its container argument already applied. */\ntype BoundQuery<Q extends Query> = Q extends (container: Container, ...args: infer A) => infer R\n ? (...args: A) => R\n : never;\n\n/** Custom queries with their container argument already applied, keyed as they were passed in. */\ntype BoundCustomQueries<Q extends QueryMap> = { [K in keyof Q]: BoundQuery<Q[K]> };\n\n/** What each variant of a query family yields for the widget type it matched. */\ntype QueryFamilyReturns<T extends Gtk.Accessible> = {\n /** The single match, or null when nothing matched; throws when more than one matched. */\n queryBy: T | null;\n /** Every match, empty when nothing matched. */\n queryAllBy: T[];\n /** The single match; throws when nothing or more than one matched. */\n getBy: T;\n /** Every match; throws when nothing matched. */\n getAllBy: T[];\n /** The single match, retried until it appears or the timeout elapses. */\n findBy: Promise<T>;\n /** Every match, retried until at least one appears or the timeout elapses. */\n findAllBy: Promise<T[]>;\n};\n\n/** What a query family matches against, which fixes the arguments it takes. */\ntype QueryKind = \"role\" | \"text\" | \"name\" | \"value\";\n\n/** The arguments a query of the given kind takes after the family's leading ones. */\ntype QueryArgs<Kind extends QueryKind, T extends Gtk.Accessible> = Kind extends \"role\"\n ? [role: Gtk.AccessibleRole, options?: ByRoleOptions<T>]\n : Kind extends \"name\"\n ? [name: Matcher, options?: MatcherOptions<T>]\n : Kind extends \"value\"\n ? [value: Matcher, options?: MatcherOptions<T>]\n : [text: Matcher, options?: MatcherOptions<T>];\n\n/**\n * One family's query variants, each named for its variant followed by `Suffix` and taking `Head`\n * ahead of the family's own arguments.\n */\ntype QueryFamily<Suffix extends string, Kind extends QueryKind, Head extends unknown[]> = {\n [K in keyof QueryFamilyReturns<Gtk.Widget> as `${K & string}${Suffix}`]: <\n T extends Gtk.Accessible = Gtk.Widget,\n >(\n ...args: [...Head, ...QueryArgs<Kind, T>]\n ) => QueryFamilyReturns<T>[K];\n};\n\n/**\n * Every built-in query, spanning the Role, LabelText, Text, Name, PlaceholderText, and DisplayValue\n * families, with `Head` prepended to each signature.\n */\ntype QueryFamilies<Head extends unknown[]> = QueryFamily<\"Role\", \"role\", Head> &\n QueryFamily<\"LabelText\", \"text\", Head> &\n QueryFamily<\"Text\", \"text\", Head> &\n QueryFamily<\"Name\", \"name\", Head> &\n QueryFamily<\"PlaceholderText\", \"text\", Head> &\n QueryFamily<\"DisplayValue\", \"value\", Head>;\n\n/**\n * Options for {@link render}: the container and base element to mount into, an optional wrapper,\n * React behavior toggles, error callbacks, and custom queries to bind.\n */\ntype RenderOptions<Q extends QueryMap = Record<never, never>> = {\n /**\n * Widget or root element to mount into; an undecorated harness window is created when omitted.\n * A widget container that sits outside every toplevel, such as a bare `Gtk.Box`, keeps the tree\n * out of reach of a pointer and a keyboard, so every `userEvent` helper aimed at it rejects\n * after `actionabilityTimeout`; `fireEvent` drives such a tree instead.\n */\n container?: Gtk.Accessible | RootElement | undefined;\n /** Root of the subtree that bound queries search. */\n baseElement?: Container | undefined;\n /** Component wrapped around the rendered element, such as a context provider. */\n wrapper?: WrapperComponent | undefined;\n /** Render inside React StrictMode. */\n isReactStrictMode?: boolean | undefined;\n /** Enable widget animations during the test. */\n areAnimationsEnabled?: boolean | undefined;\n /** Called for errors caught by React error boundaries. */\n onCaughtError?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined;\n /** Called for errors React recovered from automatically. */\n onRecoverableError?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined;\n /** Custom queries to bind to the rendered result. */\n queries?: Q | undefined;\n};\n\n/** Console helpers bundled with the bound queries on {@link screen} and on a render result. */\ntype DebugUtilities = {\n /** Prints the widget tree of the given containers, or of the whole scope, to the console. */\n debug: (element?: Container | Container[], options?: PrettyWidgetOptions) => void;\n /** Prints the accessible roles found in the scope, with the widgets carrying each one. */\n logRoles: () => void;\n /**\n * Captures what is on screen, which is the active toplevel window: GTK4 exposes no position for\n * a toplevel, so windows cannot be composited into a single image.\n */\n screenshot: (options?: ScreenshotOptions) => Promise<ScreenshotResult>;\n};\n\n/** A captured screenshot: base64-encoded image data, its MIME type, and pixel dimensions. */\ntype ScreenshotResult = {\n /** Base64-encoded image bytes. */\n data: string;\n /** MIME type of the encoded image, always `image/png`. */\n mimeType: string;\n /** Image width in pixels, after the scale factor is applied. */\n width: number;\n /** Image height in pixels, after the scale factor is applied. */\n height: number;\n};\n\n/**\n * Options for capturing a screenshot: the poll timeout and interval, a rendering scale factor, and\n * a file to write the PNG to.\n */\ntype ScreenshotOptions = Pick<WaitForOptions, \"timeout\" | \"interval\"> & {\n /** Device scale factor applied when rendering. */\n scale?: number | undefined;\n /** File the PNG is written to, with its parent directories created as needed. */\n path?: string | undefined;\n};\n\n/**\n * Options for {@link renderHook}: an optional wrapper and the initial props (required unless the\n * props type permits undefined).\n */\ntype RenderHookOptions<Props> = {\n /** Component wrapped around the one calling the hook, such as a context provider. */\n wrapper?: WrapperComponent;\n} & (undefined extends Props\n ? {\n /** Props the hook is invoked with until `rerender` is given new ones. */\n initialProps?: Props;\n }\n : {\n initialProps: Props;\n });\n\n/**\n * The result of {@link renderHook}: the latest hook return value plus functions to rerender with new\n * props and to unmount.\n */\ntype RenderHookResult<Result, Props> = {\n /** Stable object the hook's return value is written to on every render. */\n result: {\n /** The hook's latest return value. */\n current: Result;\n };\n /** Re-invokes the hook, keeping the previous props when none are given. */\n rerender: (newProps?: Props) => Promise<void>;\n /** Unmounts the component that calls the hook. */\n unmount: () => Promise<void>;\n};\n\nexport {\n type MatcherFunction,\n type Matcher,\n type NormalizerFn,\n type NormalizerOptions,\n type WaitForOptions,\n type MatcherOptions,\n type ByRoleValue,\n type ByRoleOptions,\n type WidgetType,\n type WrapperComponent,\n type QueryMap,\n type BoundCustomQueries,\n type QueryFamilies,\n type RenderOptions,\n type DebugUtilities,\n type ScreenshotResult,\n type ScreenshotOptions,\n type RenderHookOptions,\n type RenderHookResult,\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA0QA,OAAO,EAoBN,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { CaughtErrorInfo, RootElement } from \"@gtkx/react\";\nimport type { ComponentType, ErrorInfo, ReactNode } from \"react\";\nimport type { PrettyWidgetOptions } from \"./pretty-widget.js\";\nimport type { Container } from \"./traversal.js\";\n\n/**\n * A custom matcher predicate: given a candidate widget's normalized text content and the widget\n * itself, returns whether it matches.\n */\ntype MatcherFunction = (content: string, widget: Gtk.Widget) => boolean;\n/** A value used to match widget text: a string or number, a regular expression, or a custom {@link MatcherFunction}. */\ntype Matcher = string | number | RegExp | MatcherFunction;\n/** Normalizes a widget's text before it is compared against a matcher. */\ntype NormalizerFn = (text: string) => string;\n/**\n * A widget class usable as a query's `as` constraint, such as `Gtk.Button`. Abstract classes and\n * generated GInterface pseudo-classes that extend `Gtk.Accessible` are accepted.\n */\ntype WidgetType<T extends Gtk.Accessible = Gtk.Accessible> = abstract new (\n ...args: never[]\n) => T;\n\n/** Options controlling the default text normalizer. */\ntype NormalizerOptions = {\n /** Trim leading and trailing whitespace. */\n trim?: boolean | undefined;\n /** Collapse runs of whitespace into a single space. */\n collapseWhitespace?: boolean | undefined;\n};\n\n/** Options controlling how asynchronous queries and waits poll for a condition. */\ntype WaitForOptions = {\n /** Maximum time in milliseconds to keep retrying before failing. */\n timeout?: number | undefined;\n /** Delay in milliseconds between retries. */\n interval?: number | undefined;\n /** Transforms the error thrown when the timeout elapses. */\n onTimeout?: ((error: Error) => Error) | undefined;\n /** Error whose stack trace attributes the timeout failure to the calling code. */\n stackTraceError?: Error | undefined;\n};\n\n/** Options controlling text matching and, for asynchronous queries, polling behavior. */\ntype MatcherOptions<T extends Gtk.Accessible = Gtk.Accessible> = {\n /** When true (the default), require an exact match; when false, match case-insensitively as a substring. */\n exact?: boolean | undefined;\n /** Custom normalizer replacing the default; cannot be combined with `trim` or `collapseWhitespace`. */\n normalizer?: NormalizerFn | undefined;\n /** Forwarded to the default normalizer when no custom `normalizer` is given. */\n trim?: boolean | undefined;\n /** Forwarded to the default normalizer when no custom `normalizer` is given. */\n collapseWhitespace?: boolean | undefined;\n /** Whether to include a suggested better query in error messages. */\n suggest?: boolean | undefined;\n /** Restricts matches to instances of this widget class, and narrows the query's return type to it. */\n as?: WidgetType<T> | undefined;\n} & WaitForOptions;\n\n/**\n * Constraints on a widget's numeric range value used by role queries. The numbers come from the\n * accessibility tree and match within 0.001, the resolution GTK keeps them to.\n */\ntype ByRoleValue = {\n /** The current value. */\n now?: number | undefined;\n /** The lower bound of the value's range. */\n min?: number | undefined;\n /**\n * The highest value the widget can reach, which on a paged widget such as a scrollbar is its\n * adjustment's upper bound less one page.\n */\n max?: number | undefined;\n /** Matcher for the value's textual representation. */\n text?: Matcher | undefined;\n};\n\n/** Options for role queries: an accessible name matcher plus accessible state and value constraints. */\ntype ByRoleOptions<T extends Gtk.Accessible = Gtk.Accessible> = MatcherOptions<T> & {\n /** Matcher for the widget's accessible name. */\n name?: Matcher | undefined;\n /** Required checked state; a mixed check button reads as neither, so it matches neither value. */\n checked?: boolean | undefined;\n /** Required active state of a toggle button; any other widget matches neither value. */\n pressed?: boolean | undefined;\n /** Required selected state of a row, list item, grid cell, option or tree item. */\n selected?: boolean | undefined;\n /** Required expanded state of an expander or tree expander. */\n expanded?: boolean | undefined;\n /** Heading or hierarchy level. */\n level?: number | undefined;\n /** Required busy state, which an unset state satisfies as false. */\n busy?: boolean | undefined;\n /** Matcher for the widget's own accessible description, ignoring its `described-by` targets. */\n description?: Matcher | undefined;\n /** Constraints on the widget's range value, each checked only when given. */\n value?: ByRoleValue | undefined;\n /** When true, include widgets excluded from the accessibility tree. Widgets that are not mapped stay excluded. */\n hidden?: boolean | undefined;\n};\n\n/** A React component that wraps rendered content, receiving it as its children. */\ntype WrapperComponent = ComponentType<{\n children: ReactNode;\n}>;\n\n/** A custom query, taking the scope to search as its first argument and its matcher arguments after it. */\ntype Query = (container: Container, ...args: never[]) => unknown;\n/** Custom queries keyed by the name each is bound under. */\ntype QueryMap = Record<string, Query>;\n\n/** A query with its container argument already applied. */\ntype BoundQuery<Q extends Query> = Q extends (container: Container, ...args: infer A) => infer R\n ? (...args: A) => R\n : never;\n\n/** Custom queries with their container argument already applied, keyed as they were passed in. */\ntype BoundCustomQueries<Q extends QueryMap> = { [K in keyof Q]: BoundQuery<Q[K]> };\n\n/** What each variant of a query family yields for the widget type it matched. */\ntype QueryFamilyReturns<T extends Gtk.Accessible> = {\n /** The single match, or null when nothing matched; throws when more than one matched. */\n queryBy: T | null;\n /** Every match, empty when nothing matched. */\n queryAllBy: T[];\n /** The single match; throws when nothing or more than one matched. */\n getBy: T;\n /** Every match; throws when nothing matched. */\n getAllBy: T[];\n /** The single match, retried until it appears or the timeout elapses. */\n findBy: Promise<T>;\n /** Every match, retried until at least one appears or the timeout elapses. */\n findAllBy: Promise<T[]>;\n};\n\n/** What a query family matches against, which fixes the arguments it takes. */\ntype QueryKind = \"role\" | \"text\" | \"name\" | \"value\";\n\n/** The arguments a query of the given kind takes after the family's leading ones. */\ntype QueryArgs<Kind extends QueryKind, T extends Gtk.Accessible> = Kind extends \"role\"\n ? [role: Gtk.AccessibleRole, options?: ByRoleOptions<T>]\n : Kind extends \"name\"\n ? [name: Matcher, options?: MatcherOptions<T>]\n : Kind extends \"value\"\n ? [value: Matcher, options?: MatcherOptions<T>]\n : [text: Matcher, options?: MatcherOptions<T>];\n\n/**\n * One family's query variants, each named for its variant followed by `Suffix` and taking `Head`\n * ahead of the family's own arguments.\n */\ntype QueryFamily<Suffix extends string, Kind extends QueryKind, Head extends unknown[]> = {\n [K in keyof QueryFamilyReturns<Gtk.Widget> as `${K & string}${Suffix}`]: <\n T extends Gtk.Accessible = Gtk.Widget,\n >(\n ...args: [...Head, ...QueryArgs<Kind, T>]\n ) => QueryFamilyReturns<T>[K];\n};\n\n/**\n * Every built-in query, spanning the Role, LabelText, Text, Name, PlaceholderText, and DisplayValue\n * families, with `Head` prepended to each signature.\n */\ntype QueryFamilies<Head extends unknown[]> = QueryFamily<\"Role\", \"role\", Head> &\n QueryFamily<\"LabelText\", \"text\", Head> &\n QueryFamily<\"Text\", \"text\", Head> &\n QueryFamily<\"Name\", \"name\", Head> &\n QueryFamily<\"PlaceholderText\", \"text\", Head> &\n QueryFamily<\"DisplayValue\", \"value\", Head>;\n\n/**\n * Options for {@link render}: the container and base element to mount into, an optional wrapper,\n * React behavior toggles, error callbacks, and custom queries to bind.\n */\ntype RenderOptions<Q extends QueryMap = Record<never, never>> = {\n /**\n * Widget or root element to mount into; an undecorated harness window is created when omitted.\n * A widget container that sits outside every toplevel, such as a bare `Gtk.Box`, keeps the tree\n * out of reach of a pointer and a keyboard, so every `userEvent` helper aimed at it rejects\n * after `actionabilityTimeout`; `fireEvent` drives such a tree instead.\n */\n container?: Gtk.Accessible | RootElement | undefined;\n /** Root of the subtree that bound queries search. */\n baseElement?: Container | undefined;\n /** Component wrapped around the rendered element, such as a context provider. */\n wrapper?: WrapperComponent | undefined;\n /** Render inside React StrictMode. */\n isReactStrictMode?: boolean | undefined;\n /** Enable widget animations during the test. */\n areAnimationsEnabled?: boolean | undefined;\n /** Called for errors caught by React error boundaries. */\n onCaughtError?: ((error: unknown, errorInfo: CaughtErrorInfo) => void) | undefined;\n /** Called for errors React recovered from automatically. */\n onRecoverableError?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined;\n /** Custom queries to bind to the rendered result. */\n queries?: Q | undefined;\n};\n\n/** Console helpers bundled with the bound queries on {@link screen} and on a render result. */\ntype DebugUtilities = {\n /** Prints the widget tree of the given containers, or of the whole scope, to the console. */\n debug: (element?: Container | Container[], options?: PrettyWidgetOptions) => void;\n /** Prints the accessible roles found in the scope, with the widgets carrying each one. */\n logRoles: () => void;\n /**\n * Captures what is on screen, which is the active toplevel window: GTK4 exposes no position for\n * a toplevel, so windows cannot be composited into a single image.\n */\n screenshot: (options?: ScreenshotOptions) => Promise<ScreenshotResult>;\n};\n\n/** A captured screenshot: base64-encoded image data, its MIME type, and pixel dimensions. */\ntype ScreenshotResult = {\n /** Base64-encoded image bytes. */\n data: string;\n /** MIME type of the encoded image, always `image/png`. */\n mimeType: string;\n /** Image width in pixels, after the scale factor is applied. */\n width: number;\n /** Image height in pixels, after the scale factor is applied. */\n height: number;\n};\n\n/**\n * Options for capturing a screenshot: the poll timeout and interval, a rendering scale factor, and\n * a file to write the PNG to.\n */\ntype ScreenshotOptions = Pick<WaitForOptions, \"timeout\" | \"interval\"> & {\n /** Device scale factor applied when rendering. */\n scale?: number | undefined;\n /** File the PNG is written to, with its parent directories created as needed. */\n path?: string | undefined;\n};\n\n/**\n * Options for {@link renderHook}: an optional wrapper and the initial props (required unless the\n * props type permits undefined).\n */\ntype RenderHookOptions<Props> = {\n /** Component wrapped around the one calling the hook, such as a context provider. */\n wrapper?: WrapperComponent;\n} & (undefined extends Props\n ? {\n /** Props the hook is invoked with until `rerender` is given new ones. */\n initialProps?: Props;\n }\n : {\n initialProps: Props;\n });\n\n/**\n * The result of {@link renderHook}: the latest hook return value plus functions to rerender with new\n * props and to unmount.\n */\ntype RenderHookResult<Result, Props> = {\n /** Stable object the hook's return value is written to on every render. */\n result: {\n /** The hook's latest return value. */\n current: Result;\n };\n /** Re-invokes the hook, keeping the previous props when none are given. */\n rerender: (newProps?: Props) => Promise<void>;\n /** Unmounts the component that calls the hook. */\n unmount: () => Promise<void>;\n};\n\nexport {\n type MatcherFunction,\n type Matcher,\n type NormalizerFn,\n type NormalizerOptions,\n type WaitForOptions,\n type MatcherOptions,\n type ByRoleValue,\n type ByRoleOptions,\n type WidgetType,\n type WrapperComponent,\n type QueryMap,\n type BoundCustomQueries,\n type QueryFamilies,\n type RenderOptions,\n type DebugUtilities,\n type ScreenshotResult,\n type ScreenshotOptions,\n type RenderHookOptions,\n type RenderHookResult,\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/testing",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-beta.9",
4
4
  "description": "Queries, events, and screenshots for Adwaita and GTK4 widget trees.",
5
5
  "keywords": [
6
6
  "gtkx",
@@ -64,19 +64,20 @@
64
64
  "node": ">=26.7.0"
65
65
  },
66
66
  "dependencies": {
67
- "@gtkx/runtime": "2.0.0-beta.7",
68
- "@gtkx/react": "2.0.0-beta.7",
69
- "@gtkx/utils": "2.0.0-beta.7",
70
- "@vitest/expect": "^4.1.11",
71
- "@vitest/pretty-format": "^4.1.11"
67
+ "@gtkx/runtime": "2.0.0-beta.9",
68
+ "@gtkx/react": "2.0.0-beta.9",
69
+ "@gtkx/utils": "2.0.0-beta.9",
70
+ "@vitest/pretty-format": "^5.0.0"
72
71
  },
73
72
  "peerDependencies": {
74
73
  "@types/react": "^19.2",
75
- "react": "^19.2"
74
+ "react": "^19.2",
75
+ "vitest": ">=5"
76
76
  },
77
77
  "devDependencies": {
78
- "@gtkx/config": "2.0.0-beta.7",
79
- "@types/react": "^19.2.18"
78
+ "@gtkx/config": "2.0.0-beta.9",
79
+ "@types/react": "^19.2.18",
80
+ "vitest": "^5.0.0"
80
81
  },
81
82
  "scripts": {
82
83
  "release": "tsx ../../scripts/release-package.ts"
package/src/matchers.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { SyncExpectationResult } from "@vitest/expect";
1
+ import type { SyncMatcherResult } from "vitest";
2
2
  import * as GObject from "@gtkx/gi/gobject";
3
3
  import * as Gtk from "@gtkx/gi/gtk";
4
4
  import type { ByRoleOptions, Matcher, MatcherOptions } from "./types.js";
@@ -57,7 +57,7 @@ type TextContentOptions = {
57
57
  /** The expected value for a style class: an exact class name or a regular expression. */
58
58
  type ClassExpectation = string | RegExp;
59
59
  /** The outcome of a matcher: whether it passed, and the failure text built on demand. */
60
- type MatcherResult = Pick<SyncExpectationResult, "message" | "pass">;
60
+ type MatcherResult = Pick<SyncMatcherResult, "message" | "pass">;
61
61
 
62
62
  /** The matcher state bound as `this`, supplying the test runner's deep equality check. */
63
63
  type MatcherContext = {
@@ -1000,64 +1000,62 @@ const registerMatchers = (): void => {
1000
1000
  registration.isRegistered = true;
1001
1001
  };
1002
1002
 
1003
- declare module "@vitest/expect" {
1004
- /* eslint-disable @typescript-eslint/consistent-type-definitions -- declaration merging requires interfaces */
1005
- interface WidgetMatchers {
1006
- toHaveDisplayValue(expected?: TextExpectation): void;
1007
- toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): void;
1008
- toHaveAccessibleName(expected?: TextExpectation): void;
1009
- toHaveAccessibleDescription(expected?: TextExpectation): void;
1010
- toHaveAccessibleErrorMessage(expected?: TextExpectation): void;
1011
- toHaveSelection(expected?: TextExpectation): void;
1003
+ declare module "vitest" {
1004
+ /* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars --
1005
+ declaration merging requires an interface with vitest's exact type parameters */
1006
+ interface Matchers<R extends void | Promise<void> = void | Promise<void>, T = unknown> {
1007
+ toHaveDisplayValue(expected?: TextExpectation): R;
1008
+ toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): R;
1009
+ toHaveAccessibleName(expected?: TextExpectation): R;
1010
+ toHaveAccessibleDescription(expected?: TextExpectation): R;
1011
+ toHaveAccessibleErrorMessage(expected?: TextExpectation): R;
1012
+ toHaveSelection(expected?: TextExpectation): R;
1012
1013
  /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */
1013
- toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): void;
1014
- toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): void;
1015
- toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): void;
1016
- toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): void;
1014
+ toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): R;
1015
+ toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): R;
1016
+ toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): R;
1017
+ toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): R;
1017
1018
  /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */
1018
- toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): void;
1019
- toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): void;
1019
+ toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): R;
1020
+ toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): R;
1020
1021
  toHaveAccessibleProperty(
1021
1022
  property: Gtk.AccessibleProperty.AUTOCOMPLETE,
1022
1023
  expected?: Gtk.AccessibleAutocomplete,
1023
- ): void;
1024
- toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): void;
1025
- toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): void;
1026
- toBeChecked(): void;
1027
- toBePartiallyChecked(): void;
1028
- toBePressed(): void;
1029
- toBePartiallyPressed(): void;
1030
- toBeDisabled(): void;
1031
- toBeEnabled(): void;
1032
- toBeVisible(): void;
1033
- toBeRooted(): void;
1034
- toBeEmptyWidget(): void;
1035
- toBeInvalid(): void;
1036
- toBeValid(): void;
1037
- toBeRequired(): void;
1038
- toHaveFocus(): void;
1039
- toHaveValue(expected?: number | string): void;
1040
- toHaveRole(expected: Gtk.AccessibleRole): void;
1041
- toContainElement(descendant: Gtk.Accessible | null): void;
1042
- toAppearBefore(other: Gtk.Accessible): void;
1043
- toAppearAfter(other: Gtk.Accessible): void;
1044
- toContainAnyByRole(...args: RoleQueryArgs): void;
1045
- toContainOneByRole(...args: RoleQueryArgs): void;
1046
- toContainAnyByText(...args: TextQueryArgs): void;
1047
- toContainOneByText(...args: TextQueryArgs): void;
1048
- toContainAnyByLabelText(...args: TextQueryArgs): void;
1049
- toContainOneByLabelText(...args: TextQueryArgs): void;
1050
- toContainAnyByPlaceholderText(...args: TextQueryArgs): void;
1051
- toContainOneByPlaceholderText(...args: TextQueryArgs): void;
1052
- toContainAnyByDisplayValue(...args: TextQueryArgs): void;
1053
- toContainOneByDisplayValue(...args: TextQueryArgs): void;
1054
- toHaveClass(...args: (ClassExpectation | { exact: boolean })[]): void;
1055
- toHaveObjectProperty(name: string, expected?: unknown): void;
1024
+ ): R;
1025
+ toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): R;
1026
+ toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): R;
1027
+ toBeChecked(): R;
1028
+ toBePartiallyChecked(): R;
1029
+ toBePressed(): R;
1030
+ toBePartiallyPressed(): R;
1031
+ toBeDisabled(): R;
1032
+ toBeEnabled(): R;
1033
+ toBeVisible(): R;
1034
+ toBeRooted(): R;
1035
+ toBeEmptyWidget(): R;
1036
+ toBeInvalid(): R;
1037
+ toBeValid(): R;
1038
+ toBeRequired(): R;
1039
+ toHaveFocus(): R;
1040
+ toHaveValue(expected?: number | string): R;
1041
+ toHaveRole(expected: Gtk.AccessibleRole): R;
1042
+ toContainElement(descendant: Gtk.Accessible | null): R;
1043
+ toAppearBefore(other: Gtk.Accessible): R;
1044
+ toAppearAfter(other: Gtk.Accessible): R;
1045
+ toContainAnyByRole(...args: RoleQueryArgs): R;
1046
+ toContainOneByRole(...args: RoleQueryArgs): R;
1047
+ toContainAnyByText(...args: TextQueryArgs): R;
1048
+ toContainOneByText(...args: TextQueryArgs): R;
1049
+ toContainAnyByLabelText(...args: TextQueryArgs): R;
1050
+ toContainOneByLabelText(...args: TextQueryArgs): R;
1051
+ toContainAnyByPlaceholderText(...args: TextQueryArgs): R;
1052
+ toContainOneByPlaceholderText(...args: TextQueryArgs): R;
1053
+ toContainAnyByDisplayValue(...args: TextQueryArgs): R;
1054
+ toContainOneByDisplayValue(...args: TextQueryArgs): R;
1055
+ toHaveClass(...args: (ClassExpectation | { exact: boolean })[]): R;
1056
+ toHaveObjectProperty(name: string, expected?: unknown): R;
1056
1057
  }
1057
-
1058
- interface Assertion extends WidgetMatchers {}
1059
- interface AsymmetricMatchersContaining extends WidgetMatchers {}
1060
- /* eslint-enable @typescript-eslint/consistent-type-definitions */
1058
+ /* eslint-enable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars */
1061
1059
  }
1062
1060
 
1063
1061
  export { matchers, registerMatchers, type ClassExpectation, type TextContentOptions, type TextExpectation };
package/src/render.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import type { RootElement } from "@gtkx/react";
1
+ import type { CaughtErrorInfo, RootElement } from "@gtkx/react";
2
2
  import * as Gtk from "@gtkx/gi/gtk";
3
3
  import {
4
4
  createReconcilerRoot,
@@ -193,7 +193,7 @@ const settleRender = async (
193
193
 
194
194
  const renderErrorHandlers = <Q extends QueryMap>(options: RenderOptions<Q> | undefined) => ({
195
195
  onUncaughtError: handleError,
196
- onCaughtError: (error: unknown, errorInfo: ErrorInfo): void => {
196
+ onCaughtError: (error: unknown, errorInfo: CaughtErrorInfo): void => {
197
197
  handleError(error);
198
198
  options?.onCaughtError?.(error, errorInfo);
199
199
  },
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type * as Gtk from "@gtkx/gi/gtk";
2
- import type { RootElement } from "@gtkx/react";
2
+ import type { CaughtErrorInfo, RootElement } from "@gtkx/react";
3
3
  import type { ComponentType, ErrorInfo, ReactNode } from "react";
4
4
  import type { PrettyWidgetOptions } from "./pretty-widget.js";
5
5
  import type { Container } from "./traversal.js";
@@ -189,7 +189,7 @@ type RenderOptions<Q extends QueryMap = Record<never, never>> = {
189
189
  /** Enable widget animations during the test. */
190
190
  areAnimationsEnabled?: boolean | undefined;
191
191
  /** Called for errors caught by React error boundaries. */
192
- onCaughtError?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined;
192
+ onCaughtError?: ((error: unknown, errorInfo: CaughtErrorInfo) => void) | undefined;
193
193
  /** Called for errors React recovered from automatically. */
194
194
  onRecoverableError?: ((error: unknown, errorInfo: ErrorInfo) => void) | undefined;
195
195
  /** Custom queries to bind to the rendered result. */