@gtkx/testing 2.0.0-beta.3 → 2.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/build-queries.d.ts +9 -9
  2. package/dist/build-queries.d.ts.map +1 -1
  3. package/dist/build-queries.js +2 -1
  4. package/dist/build-queries.js.map +1 -1
  5. package/dist/fire-event.d.ts +3 -3
  6. package/dist/fire-event.d.ts.map +1 -1
  7. package/dist/fire-event.js +14 -4
  8. package/dist/fire-event.js.map +1 -1
  9. package/dist/matchers.d.ts +6 -6
  10. package/dist/matchers.d.ts.map +1 -1
  11. package/dist/matchers.js +3 -2
  12. package/dist/matchers.js.map +1 -1
  13. package/dist/queries.d.ts +7 -7
  14. package/dist/queries.d.ts.map +1 -1
  15. package/dist/queries.js +16 -9
  16. package/dist/queries.js.map +1 -1
  17. package/dist/query-helpers.d.ts +2 -2
  18. package/dist/query-helpers.d.ts.map +1 -1
  19. package/dist/query-helpers.js +2 -1
  20. package/dist/query-helpers.js.map +1 -1
  21. package/dist/render.d.ts.map +1 -1
  22. package/dist/render.js +4 -0
  23. package/dist/render.js.map +1 -1
  24. package/dist/role-helpers.d.ts +1 -1
  25. package/dist/role-helpers.d.ts.map +1 -1
  26. package/dist/role-helpers.js +2 -1
  27. package/dist/role-helpers.js.map +1 -1
  28. package/dist/screenshot.d.ts +1 -1
  29. package/dist/screenshot.d.ts.map +1 -1
  30. package/dist/screenshot.js +3 -1
  31. package/dist/screenshot.js.map +1 -1
  32. package/dist/suggestions.d.ts +1 -1
  33. package/dist/suggestions.d.ts.map +1 -1
  34. package/dist/suggestions.js +3 -1
  35. package/dist/suggestions.js.map +1 -1
  36. package/dist/traversal.d.ts +3 -3
  37. package/dist/traversal.d.ts.map +1 -1
  38. package/dist/traversal.js +1 -1
  39. package/dist/traversal.js.map +1 -1
  40. package/dist/types.d.ts +8 -8
  41. package/dist/types.d.ts.map +1 -1
  42. package/dist/types.js.map +1 -1
  43. package/dist/user-event/controller.d.ts +5 -5
  44. package/dist/user-event/controller.d.ts.map +1 -1
  45. package/dist/user-event/controller.js +5 -2
  46. package/dist/user-event/controller.js.map +1 -1
  47. package/dist/user-event/index.d.ts +22 -22
  48. package/dist/user-event/index.d.ts.map +1 -1
  49. package/dist/user-event/index.js +28 -25
  50. package/dist/user-event/index.js.map +1 -1
  51. package/dist/user-event/selection.d.ts +2 -2
  52. package/dist/user-event/selection.d.ts.map +1 -1
  53. package/dist/user-event/selection.js +8 -2
  54. package/dist/user-event/selection.js.map +1 -1
  55. package/dist/wait-for.d.ts +2 -2
  56. package/dist/wait-for.d.ts.map +1 -1
  57. package/dist/wait-for.js +6 -4
  58. package/dist/wait-for.js.map +1 -1
  59. package/dist/widget-accessible-properties.d.ts +2 -2
  60. package/dist/widget-accessible-properties.d.ts.map +1 -1
  61. package/dist/widget-accessible-properties.js +3 -1
  62. package/dist/widget-accessible-properties.js.map +1 -1
  63. package/dist/widget-getters.d.ts +7 -9
  64. package/dist/widget-getters.d.ts.map +1 -1
  65. package/dist/widget-getters.js.map +1 -1
  66. package/dist/widget-target.d.ts +4 -0
  67. package/dist/widget-target.d.ts.map +1 -0
  68. package/dist/widget-target.js +9 -0
  69. package/dist/widget-target.js.map +1 -0
  70. package/package.json +5 -5
  71. package/src/build-queries.ts +60 -30
  72. package/src/fire-event.ts +32 -8
  73. package/src/matchers.ts +13 -12
  74. package/src/queries.ts +61 -29
  75. package/src/query-helpers.ts +9 -7
  76. package/src/render.tsx +5 -0
  77. package/src/role-helpers.ts +3 -1
  78. package/src/screenshot.ts +3 -1
  79. package/src/suggestions.ts +3 -1
  80. package/src/traversal.ts +4 -4
  81. package/src/types.ts +12 -8
  82. package/src/user-event/controller.ts +8 -5
  83. package/src/user-event/index.ts +133 -47
  84. package/src/user-event/selection.ts +12 -4
  85. package/src/wait-for.ts +9 -6
  86. package/src/widget-accessible-properties.ts +7 -5
  87. package/src/widget-getters.ts +11 -13
  88. package/src/widget-target.ts +11 -0
@@ -1 +1 @@
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,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,GAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA2MtD,MAAM,YAAY,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAC7C,MAAM,cAAc,GAAW,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC;AAC5D,MAAM,eAAe,GAAG,iEAAiE,CAAC;AAC1F,MAAM,mBAAmB,GAAgB,WAAW,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC;AAC3G,MAAM,oBAAoB,GAAgB,WAAW,CAAC,sBAAsB,EA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M,CAAC,qBAAqB,MAAM,CAAC,IAAI,CAAC,IAAI;YACjG,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;KACrF,CAAC;AACN,CAAC;AAED,gHAAgH;AAChH,MAAM,gBAAgB,GAAG,GAAS,EAAE;IAChC,IAAI,YAAY,CAAC,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) => Gtk.Widget[];\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.Widget | 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.Widget) => MatcherResult;\n /** Asserts the widget comes after the given widget in the widget tree, neither containing the other. */\n toAppearAfter: (received: unknown, other: Gtk.Widget) => 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.Widget): 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.Widget): 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.Widget | null): MatcherResult {\n const widget = asWidget(received, \"toContainElement\");\n const isPass = descendant !== null && (descendant === widget || descendant.isAncestor(widget));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to contain ` +\n `${descendant === null ? \"null\" : describeWidget(descendant)}\\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.Widget | null): void;\n toAppearBefore(other: Gtk.Widget): void;\n toAppearAfter(other: Gtk.Widget): 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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AAE,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"]}
package/dist/queries.d.ts CHANGED
@@ -65,7 +65,7 @@ declare const findAllByDisplayValue: BuiltinQueries["findAllByDisplayValue"];
65
65
  /** Finds one mapped widget by display value. */
66
66
  declare const findByDisplayValue: BuiltinQueries["findByDisplayValue"];
67
67
  declare const isTextMatch: (actual: string | null, expected: Matcher, widget: Gtk.Widget, options?: MatcherOptions) => boolean;
68
- declare const isMatchingWidgetType: (widget: Gtk.Widget, options?: MatcherOptions) => boolean;
68
+ declare const isMatchingWidgetType: <T extends Gtk.Accessible>(widget: Gtk.Widget, options?: MatcherOptions<T>) => widget is Gtk.Widget & T;
69
69
  /**
70
70
  * Finds every widget under the container whose accessible role matches `role` and that satisfies the given options.
71
71
  * Widgets that are not mapped are never matched, and widgets excluded from the accessibility tree are
@@ -75,7 +75,7 @@ declare const isMatchingWidgetType: (widget: Gtk.Widget, options?: MatcherOption
75
75
  * @param options Additional accessible name, state, and value constraints.
76
76
  * @returns Every matching widget, or an empty array when none match.
77
77
  */
78
- declare function queryAllByRole(container: Container, role: Gtk.AccessibleRole, options?: ByRoleOptions): Gtk.Widget[];
78
+ declare function queryAllByRole<T extends Gtk.Accessible = Gtk.Widget>(container: Container, role: Gtk.AccessibleRole, options?: ByRoleOptions<T>): T[];
79
79
  /**
80
80
  * Finds every widget associated with a label whose text matches: a Gtk.Label mnemonic target, the
81
81
  * widget's own accessible label, or its labelled-by relation. Widgets that are not mapped are never matched.
@@ -84,7 +84,7 @@ declare function queryAllByRole(container: Container, role: Gtk.AccessibleRole,
84
84
  * @param options Text matching options.
85
85
  * @returns Every matching widget, or an empty array when none match.
86
86
  */
87
- declare function queryAllByLabelText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[];
87
+ declare function queryAllByLabelText<T extends Gtk.Accessible = Gtk.Widget>(container: Container, text: Matcher, options?: MatcherOptions<T>): T[];
88
88
  /**
89
89
  * Finds every widget whose rendered text content matches. Widgets that are not mapped are never matched.
90
90
  * @param container Widget subtree to search.
@@ -92,7 +92,7 @@ declare function queryAllByLabelText(container: Container, text: Matcher, option
92
92
  * @param options Text matching options.
93
93
  * @returns Every matching widget, or an empty array when none match.
94
94
  */
95
- declare function queryAllByText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[];
95
+ declare function queryAllByText<T extends Gtk.Accessible = Gtk.Widget>(container: Container, text: Matcher, options?: MatcherOptions<T>): T[];
96
96
  /**
97
97
  * Finds every widget whose widget name matches. Widgets that are not mapped are never matched.
98
98
  * @param container Widget subtree to search.
@@ -100,7 +100,7 @@ declare function queryAllByText(container: Container, text: Matcher, options?: M
100
100
  * @param options Text matching options.
101
101
  * @returns Every matching widget, or an empty array when none match.
102
102
  */
103
- declare function queryAllByName(container: Container, name: Matcher, options?: MatcherOptions): Gtk.Widget[];
103
+ declare function queryAllByName<T extends Gtk.Accessible = Gtk.Widget>(container: Container, name: Matcher, options?: MatcherOptions<T>): T[];
104
104
  /**
105
105
  * Finds every widget whose placeholder text matches. Widgets that are not mapped are never matched.
106
106
  * @param container Widget subtree to search.
@@ -108,7 +108,7 @@ declare function queryAllByName(container: Container, name: Matcher, options?: M
108
108
  * @param options Text matching options.
109
109
  * @returns Every matching widget, or an empty array when none match.
110
110
  */
111
- declare function queryAllByPlaceholderText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[];
111
+ declare function queryAllByPlaceholderText<T extends Gtk.Accessible = Gtk.Widget>(container: Container, text: Matcher, options?: MatcherOptions<T>): T[];
112
112
  /**
113
113
  * Finds every widget whose current display value matches. Widgets that are not mapped are never matched.
114
114
  * @param container Widget subtree to search.
@@ -116,6 +116,6 @@ declare function queryAllByPlaceholderText(container: Container, text: Matcher,
116
116
  * @param options Text matching options.
117
117
  * @returns Every matching widget, or an empty array when none match.
118
118
  */
119
- declare function queryAllByDisplayValue(container: Container, value: Matcher, options?: MatcherOptions): Gtk.Widget[];
119
+ declare function queryAllByDisplayValue<T extends Gtk.Accessible = Gtk.Widget>(container: Container, value: Matcher, options?: MatcherOptions<T>): T[];
120
120
  export { builtinQueries, isMatchingWidgetType, isTextMatch, queryByRole, getAllByRole, getByRole, findAllByRole, findByRole, queryByLabelText, getAllByLabelText, getByLabelText, findAllByLabelText, findByLabelText, queryByText, getAllByText, getByText, findAllByText, findByText, queryByName, getAllByName, getByName, findAllByName, findByName, queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText, queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue, queryAllByRole, queryAllByLabelText, queryAllByText, queryAllByName, queryAllByPlaceholderText, queryAllByDisplayValue, };
121
121
  //# sourceMappingURL=queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EACR,aAAa,EAEb,OAAO,EACP,cAAc,EAEd,aAAa,EAChB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAuBnE,6GAA6G;AAC7G,KAAK,cAAc,GAAG,aAAa,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;A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ChB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,sBAAsB,GACzB,CAAC"}
package/dist/queries.js CHANGED
@@ -157,12 +157,11 @@ const hasMatchingAccessibleStates = (widget, options) => hasMatchingBooleanState
157
157
  hasMatchingDescriptionState(widget, options) &&
158
158
  hasMatchingValueState(widget, options);
159
159
  const isMatchingWidgetType = (widget, options) => options?.as === undefined || widget instanceof options.as;
160
- const hasMatchingByRoleOptions = (widget, options) => {
160
+ const hasMatchingAccessibleOptions = (widget, options) => {
161
161
  if (!options) {
162
162
  return true;
163
163
  }
164
- return (isMatchingWidgetType(widget, options) &&
165
- hasMatchingAccessibleName(widget, options) &&
164
+ return (hasMatchingAccessibleName(widget, options) &&
166
165
  hasMatchingAccessibleStates(widget, options));
167
166
  };
168
167
  function nameQueryFamily(suffix, queryAllBy, built) {
@@ -186,15 +185,19 @@ function nameQueryFamily(suffix, queryAllBy, built) {
186
185
  * @returns Every matching widget, or an empty array when none match.
187
186
  */
188
187
  function queryAllByRole(container, role, options) {
189
- return findAll(container, (widget) => {
188
+ const matches = findAll(container, (widget) => {
190
189
  if (widget.getAccessibleRole() !== role) {
191
190
  return false;
192
191
  }
193
192
  if (!options?.hidden && isInaccessible(widget)) {
194
193
  return false;
195
194
  }
196
- return hasMatchingByRoleOptions(widget, options);
195
+ if (!isMatchingWidgetType(widget, options)) {
196
+ return false;
197
+ }
198
+ return hasMatchingAccessibleOptions(widget, options);
197
199
  });
200
+ return matches.filter((widget) => isMatchingWidgetType(widget, options));
198
201
  }
199
202
  const collectMnemonicMatch = (widget, text, options) => {
200
203
  if (!(widget instanceof Gtk.Label)) {
@@ -243,7 +246,8 @@ function queryAllByLabelText(container, text, options) {
243
246
  * @returns Every matching widget, or an empty array when none match.
244
247
  */
245
248
  function queryAllByText(container, text, options) {
246
- return findAll(container, (widget) => isMatchingWidgetType(widget, options) && isTextMatch(getWidgetLabelText(widget), text, widget, options));
249
+ const matches = findAll(container, (widget) => isMatchingWidgetType(widget, options) && isTextMatch(getWidgetLabelText(widget), text, widget, options));
250
+ return matches.filter((widget) => isMatchingWidgetType(widget, options));
247
251
  }
248
252
  /**
249
253
  * Finds every widget whose widget name matches. Widgets that are not mapped are never matched.
@@ -253,7 +257,8 @@ function queryAllByText(container, text, options) {
253
257
  * @returns Every matching widget, or an empty array when none match.
254
258
  */
255
259
  function queryAllByName(container, name, options) {
256
- return findAll(container, (widget) => isMatchingWidgetType(widget, options) && isTextMatch(getWidgetName(widget), name, widget, options));
260
+ const matches = findAll(container, (widget) => isMatchingWidgetType(widget, options) && isTextMatch(getWidgetName(widget), name, widget, options));
261
+ return matches.filter((widget) => isMatchingWidgetType(widget, options));
257
262
  }
258
263
  /**
259
264
  * Finds every widget whose placeholder text matches. Widgets that are not mapped are never matched.
@@ -263,8 +268,9 @@ function queryAllByName(container, name, options) {
263
268
  * @returns Every matching widget, or an empty array when none match.
264
269
  */
265
270
  function queryAllByPlaceholderText(container, text, options) {
266
- return findAll(container, (widget) => isMatchingWidgetType(widget, options) &&
271
+ const matches = findAll(container, (widget) => isMatchingWidgetType(widget, options) &&
267
272
  isTextMatch(getWidgetPlaceholderText(widget), text, widget, options));
273
+ return matches.filter((widget) => isMatchingWidgetType(widget, options));
268
274
  }
269
275
  /**
270
276
  * Finds every widget whose current display value matches. Widgets that are not mapped are never matched.
@@ -274,8 +280,9 @@ function queryAllByPlaceholderText(container, text, options) {
274
280
  * @returns Every matching widget, or an empty array when none match.
275
281
  */
276
282
  function queryAllByDisplayValue(container, value, options) {
277
- return findAll(container, (widget) => isMatchingWidgetType(widget, options) &&
283
+ const matches = findAll(container, (widget) => isMatchingWidgetType(widget, options) &&
278
284
  isTextMatch(getWidgetDisplayValue(widget), value, widget, options));
285
+ return matches.filter((widget) => isMatchingWidgetType(widget, options));
279
286
  }
280
287
  export { builtinQueries, isMatchingWidgetType, isTextMatch, queryByRole, getAllByRole, getByRole, findAllByRole, findByRole, queryByLabelText, getAllByLabelText, getByLabelText, findAllByLabelText, findByLabelText, queryByText, getAllByText, getByText, findAllByText, findByText, queryByName, getAllByName, getByName, findAllByName, findByName, queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText, queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue, queryAllByRole, queryAllByLabelText, queryAllByText, queryAllByName, queryAllByPlaceholderText, queryAllByDisplayValue, };
281
288
  //# sourceMappingURL=queries.js.map