@gtkx/testing 2.0.0-beta.1 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -40
- package/dist/accessible-native.d.ts +1 -1
- package/dist/accessible-native.d.ts.map +1 -1
- package/dist/accessible-native.js +29 -8
- package/dist/accessible-native.js.map +1 -1
- package/dist/build-queries.d.ts +9 -9
- package/dist/build-queries.d.ts.map +1 -1
- package/dist/build-queries.js +2 -1
- package/dist/build-queries.js.map +1 -1
- package/dist/fire-event.d.ts +3 -3
- package/dist/fire-event.d.ts.map +1 -1
- package/dist/fire-event.js +14 -4
- package/dist/fire-event.js.map +1 -1
- package/dist/matchers.d.ts +52 -56
- package/dist/matchers.d.ts.map +1 -1
- package/dist/matchers.js +4 -16
- package/dist/matchers.js.map +1 -1
- package/dist/queries.d.ts +7 -7
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +18 -10
- package/dist/queries.js.map +1 -1
- package/dist/query-helpers.d.ts +2 -2
- package/dist/query-helpers.d.ts.map +1 -1
- package/dist/query-helpers.js +10 -3
- package/dist/query-helpers.js.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +4 -0
- package/dist/render.js.map +1 -1
- package/dist/role-helpers.d.ts +1 -1
- package/dist/role-helpers.d.ts.map +1 -1
- package/dist/role-helpers.js +2 -1
- package/dist/role-helpers.js.map +1 -1
- package/dist/screenshot.d.ts +1 -1
- package/dist/screenshot.d.ts.map +1 -1
- package/dist/screenshot.js +25 -5
- package/dist/screenshot.js.map +1 -1
- package/dist/suggestions.d.ts +1 -1
- package/dist/suggestions.d.ts.map +1 -1
- package/dist/suggestions.js +3 -1
- package/dist/suggestions.js.map +1 -1
- package/dist/traversal.d.ts +4 -4
- package/dist/traversal.d.ts.map +1 -1
- package/dist/traversal.js +25 -7
- package/dist/traversal.js.map +1 -1
- package/dist/types.d.ts +10 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/user-event/click.d.ts +17 -4
- package/dist/user-event/click.d.ts.map +1 -1
- package/dist/user-event/click.js +28 -9
- package/dist/user-event/click.js.map +1 -1
- package/dist/user-event/controller.d.ts +5 -5
- package/dist/user-event/controller.d.ts.map +1 -1
- package/dist/user-event/controller.js +5 -2
- package/dist/user-event/controller.js.map +1 -1
- package/dist/user-event/index.d.ts +22 -22
- package/dist/user-event/index.d.ts.map +1 -1
- package/dist/user-event/index.js +28 -25
- package/dist/user-event/index.js.map +1 -1
- package/dist/user-event/keyboard.d.ts.map +1 -1
- package/dist/user-event/keyboard.js +23 -2
- package/dist/user-event/keyboard.js.map +1 -1
- package/dist/user-event/list-row-click.d.ts +1 -1
- package/dist/user-event/list-row-click.d.ts.map +1 -1
- package/dist/user-event/list-row-click.js +2 -1
- package/dist/user-event/list-row-click.js.map +1 -1
- package/dist/user-event/pointer.d.ts.map +1 -1
- package/dist/user-event/pointer.js +9 -11
- package/dist/user-event/pointer.js.map +1 -1
- package/dist/user-event/selection.d.ts +2 -2
- package/dist/user-event/selection.d.ts.map +1 -1
- package/dist/user-event/selection.js +8 -2
- package/dist/user-event/selection.js.map +1 -1
- package/dist/wait-for.d.ts +2 -2
- package/dist/wait-for.d.ts.map +1 -1
- package/dist/wait-for.js +6 -4
- package/dist/wait-for.js.map +1 -1
- package/dist/widget-accessible-properties.d.ts +4 -3
- package/dist/widget-accessible-properties.d.ts.map +1 -1
- package/dist/widget-accessible-properties.js +24 -17
- package/dist/widget-accessible-properties.js.map +1 -1
- package/dist/widget-getters.d.ts +7 -9
- package/dist/widget-getters.d.ts.map +1 -1
- package/dist/widget-getters.js.map +1 -1
- package/dist/widget-target.d.ts +4 -0
- package/dist/widget-target.d.ts.map +1 -0
- package/dist/widget-target.js +9 -0
- package/dist/widget-target.js.map +1 -0
- package/package.json +13 -10
- package/src/accessible-native.ts +45 -9
- package/src/build-queries.ts +60 -30
- package/src/fire-event.ts +32 -8
- package/src/matchers.ts +63 -85
- package/src/queries.ts +64 -30
- package/src/query-helpers.ts +17 -9
- package/src/render.tsx +7 -2
- package/src/role-helpers.ts +3 -1
- package/src/screenshot.ts +48 -5
- package/src/suggestions.ts +3 -1
- package/src/traversal.ts +35 -11
- package/src/types.ts +14 -10
- package/src/user-event/click.ts +37 -17
- package/src/user-event/controller.ts +8 -5
- package/src/user-event/index.ts +133 -47
- package/src/user-event/keyboard.ts +32 -3
- package/src/user-event/list-row-click.ts +2 -2
- package/src/user-event/pointer.ts +11 -15
- package/src/user-event/selection.ts +12 -4
- package/src/wait-for.ts +9 -6
- package/src/widget-accessible-properties.ts +39 -25
- package/src/widget-getters.ts +11 -13
- package/src/widget-target.ts +11 -0
package/dist/matchers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SyncMatcherResult } from "vitest";
|
|
2
2
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
3
3
|
import type { ByRoleOptions, Matcher, MatcherOptions } from "./types.js";
|
|
4
4
|
import { type AccessibleAttributeValue } from "./accessible-native.js";
|
|
@@ -15,7 +15,7 @@ type TextContentOptions = {
|
|
|
15
15
|
/** The expected value for a style class: an exact class name or a regular expression. */
|
|
16
16
|
type ClassExpectation = string | RegExp;
|
|
17
17
|
/** The outcome of a matcher: whether it passed, and the failure text built on demand. */
|
|
18
|
-
type MatcherResult = Pick<
|
|
18
|
+
type MatcherResult = Pick<SyncMatcherResult, "message" | "pass">;
|
|
19
19
|
/** The matcher state bound as `this`, supplying the test runner's deep equality check. */
|
|
20
20
|
type MatcherContext = {
|
|
21
21
|
/** Compares a received value against an expected one, resolving asymmetric matchers. */
|
|
@@ -106,11 +106,11 @@ type MatcherImplementations = {
|
|
|
106
106
|
/** Asserts the widget's accessible role. */
|
|
107
107
|
toHaveRole: (received: unknown, expected: Gtk.AccessibleRole) => MatcherResult;
|
|
108
108
|
/** Asserts the widget is, or is an ancestor of, the given widget. */
|
|
109
|
-
toContainElement: (received: unknown, descendant: Gtk.
|
|
109
|
+
toContainElement: (received: unknown, descendant: Gtk.Accessible | null) => MatcherResult;
|
|
110
110
|
/** Asserts the widget comes before the given widget in the widget tree, neither containing the other. */
|
|
111
|
-
toAppearBefore: (received: unknown, other: Gtk.
|
|
111
|
+
toAppearBefore: (received: unknown, other: Gtk.Accessible) => MatcherResult;
|
|
112
112
|
/** Asserts the widget comes after the given widget in the widget tree, neither containing the other. */
|
|
113
|
-
toAppearAfter: (received: unknown, other: Gtk.
|
|
113
|
+
toAppearAfter: (received: unknown, other: Gtk.Accessible) => MatcherResult;
|
|
114
114
|
/** Asserts at least one widget under the received one matches the `ByRole` query. */
|
|
115
115
|
toContainAnyByRole: ContainmentMatcher<RoleQueryArgs>;
|
|
116
116
|
/** Asserts exactly one widget under the received one matches the `ByRole` query. */
|
|
@@ -146,59 +146,55 @@ type MatcherImplementations = {
|
|
|
146
146
|
declare const matchers: MatcherImplementations;
|
|
147
147
|
/** Registers the widget matchers on the global `expect`, when one is available. Safe to call more than once. */
|
|
148
148
|
declare const registerMatchers: () => void;
|
|
149
|
-
declare module "
|
|
150
|
-
interface
|
|
151
|
-
toHaveDisplayValue(expected?: TextExpectation):
|
|
152
|
-
toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions):
|
|
153
|
-
toHaveAccessibleName(expected?: TextExpectation):
|
|
154
|
-
toHaveAccessibleDescription(expected?: TextExpectation):
|
|
155
|
-
toHaveAccessibleErrorMessage(expected?: TextExpectation):
|
|
156
|
-
toHaveSelection(expected?: TextExpectation):
|
|
157
|
-
toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean):
|
|
158
|
-
toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate):
|
|
159
|
-
toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState):
|
|
160
|
-
toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string):
|
|
161
|
-
toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean):
|
|
162
|
-
toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number):
|
|
163
|
-
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.AUTOCOMPLETE, expected?: Gtk.AccessibleAutocomplete):
|
|
164
|
-
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation):
|
|
165
|
-
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort):
|
|
166
|
-
toBeChecked():
|
|
167
|
-
toBePartiallyChecked():
|
|
168
|
-
toBePressed():
|
|
169
|
-
toBePartiallyPressed():
|
|
170
|
-
toBeDisabled():
|
|
171
|
-
toBeEnabled():
|
|
172
|
-
toBeVisible():
|
|
173
|
-
toBeRooted():
|
|
174
|
-
toBeEmptyWidget():
|
|
175
|
-
toBeInvalid():
|
|
176
|
-
toBeValid():
|
|
177
|
-
toBeRequired():
|
|
178
|
-
toHaveFocus():
|
|
179
|
-
toHaveValue(expected?: number | string):
|
|
180
|
-
toHaveRole(expected: Gtk.AccessibleRole):
|
|
181
|
-
toContainElement(descendant: Gtk.
|
|
182
|
-
toAppearBefore(other: Gtk.
|
|
183
|
-
toAppearAfter(other: Gtk.
|
|
184
|
-
toContainAnyByRole(...args: RoleQueryArgs):
|
|
185
|
-
toContainOneByRole(...args: RoleQueryArgs):
|
|
186
|
-
toContainAnyByText(...args: TextQueryArgs):
|
|
187
|
-
toContainOneByText(...args: TextQueryArgs):
|
|
188
|
-
toContainAnyByLabelText(...args: TextQueryArgs):
|
|
189
|
-
toContainOneByLabelText(...args: TextQueryArgs):
|
|
190
|
-
toContainAnyByPlaceholderText(...args: TextQueryArgs):
|
|
191
|
-
toContainOneByPlaceholderText(...args: TextQueryArgs):
|
|
192
|
-
toContainAnyByDisplayValue(...args: TextQueryArgs):
|
|
193
|
-
toContainOneByDisplayValue(...args: TextQueryArgs):
|
|
149
|
+
declare module "vitest" {
|
|
150
|
+
interface Matchers<R extends void | Promise<void> = void | Promise<void>, T = unknown> {
|
|
151
|
+
toHaveDisplayValue(expected?: TextExpectation): R;
|
|
152
|
+
toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): R;
|
|
153
|
+
toHaveAccessibleName(expected?: TextExpectation): R;
|
|
154
|
+
toHaveAccessibleDescription(expected?: TextExpectation): R;
|
|
155
|
+
toHaveAccessibleErrorMessage(expected?: TextExpectation): R;
|
|
156
|
+
toHaveSelection(expected?: TextExpectation): R;
|
|
157
|
+
toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): R;
|
|
158
|
+
toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): R;
|
|
159
|
+
toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): R;
|
|
160
|
+
toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): R;
|
|
161
|
+
toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): R;
|
|
162
|
+
toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): R;
|
|
163
|
+
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.AUTOCOMPLETE, expected?: Gtk.AccessibleAutocomplete): R;
|
|
164
|
+
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): R;
|
|
165
|
+
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): R;
|
|
166
|
+
toBeChecked(): R;
|
|
167
|
+
toBePartiallyChecked(): R;
|
|
168
|
+
toBePressed(): R;
|
|
169
|
+
toBePartiallyPressed(): R;
|
|
170
|
+
toBeDisabled(): R;
|
|
171
|
+
toBeEnabled(): R;
|
|
172
|
+
toBeVisible(): R;
|
|
173
|
+
toBeRooted(): R;
|
|
174
|
+
toBeEmptyWidget(): R;
|
|
175
|
+
toBeInvalid(): R;
|
|
176
|
+
toBeValid(): R;
|
|
177
|
+
toBeRequired(): R;
|
|
178
|
+
toHaveFocus(): R;
|
|
179
|
+
toHaveValue(expected?: number | string): R;
|
|
180
|
+
toHaveRole(expected: Gtk.AccessibleRole): R;
|
|
181
|
+
toContainElement(descendant: Gtk.Accessible | null): R;
|
|
182
|
+
toAppearBefore(other: Gtk.Accessible): R;
|
|
183
|
+
toAppearAfter(other: Gtk.Accessible): R;
|
|
184
|
+
toContainAnyByRole(...args: RoleQueryArgs): R;
|
|
185
|
+
toContainOneByRole(...args: RoleQueryArgs): R;
|
|
186
|
+
toContainAnyByText(...args: TextQueryArgs): R;
|
|
187
|
+
toContainOneByText(...args: TextQueryArgs): R;
|
|
188
|
+
toContainAnyByLabelText(...args: TextQueryArgs): R;
|
|
189
|
+
toContainOneByLabelText(...args: TextQueryArgs): R;
|
|
190
|
+
toContainAnyByPlaceholderText(...args: TextQueryArgs): R;
|
|
191
|
+
toContainOneByPlaceholderText(...args: TextQueryArgs): R;
|
|
192
|
+
toContainAnyByDisplayValue(...args: TextQueryArgs): R;
|
|
193
|
+
toContainOneByDisplayValue(...args: TextQueryArgs): R;
|
|
194
194
|
toHaveClass(...args: (ClassExpectation | {
|
|
195
195
|
exact: boolean;
|
|
196
|
-
})[]):
|
|
197
|
-
toHaveObjectProperty(name: string, expected?: unknown):
|
|
198
|
-
}
|
|
199
|
-
interface Assertion extends WidgetMatchers {
|
|
200
|
-
}
|
|
201
|
-
interface AsymmetricMatchersContaining extends WidgetMatchers {
|
|
196
|
+
})[]): R;
|
|
197
|
+
toHaveObjectProperty(name: string, expected?: unknown): R;
|
|
202
198
|
}
|
|
203
199
|
}
|
|
204
200
|
export { matchers, registerMatchers, type ClassExpectation, type TextContentOptions, type TextExpectation };
|
package/dist/matchers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchers.d.ts","sourceRoot":"","sources":["../src/matchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"matchers.d.ts","sourceR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CAAC,EAAE,OAAO,GAAG,CAAC,CAAC;KAC7D;CAEJ;AAED,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
package/dist/matchers.js
CHANGED
|
@@ -176,7 +176,6 @@ const isAppearingBefore = (first, second) => {
|
|
|
176
176
|
const root = getTreeRoot(first);
|
|
177
177
|
return isSeparateWidget(first, second) && root === getTreeRoot(second) && isPrecedingWidget(root, first, second);
|
|
178
178
|
};
|
|
179
|
-
const camelCase = (name) => name.replaceAll(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
|
|
180
179
|
const isAsymmetricMatcher = (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "asymmetricMatch") === "function";
|
|
181
180
|
const isEqualValue = (context, actual, expected) => {
|
|
182
181
|
if (isAsymmetricMatcher(expected)) {
|
|
@@ -217,20 +216,8 @@ function readErrorMessageText(widget) {
|
|
|
217
216
|
const texts = targets.map((target) => getWidgetAccessibleName(target)).filter((text) => text !== null);
|
|
218
217
|
return texts.length > 0 ? texts.join(" ") : null;
|
|
219
218
|
}
|
|
220
|
-
function assertReadableProperty(object, name, property, value) {
|
|
221
|
-
if (typeof value === "function") {
|
|
222
|
-
throw new TypeError(`toHaveObjectProperty: "${name}" is shadowed by a method of the same name; ` +
|
|
223
|
-
`call ${property}() and assert on its result instead`);
|
|
224
|
-
}
|
|
225
|
-
if (value === undefined && !Reflect.has(object, property)) {
|
|
226
|
-
throw new TypeError(`toHaveObjectProperty: no readable property "${name}" on ${describeObject(object)}; ` +
|
|
227
|
-
"construct-only and write-only properties cannot be read back");
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
219
|
function readObjectProperty(object, name) {
|
|
231
|
-
const
|
|
232
|
-
const value = Reflect.get(object, property);
|
|
233
|
-
assertReadableProperty(object, name, property, value);
|
|
220
|
+
const value = Reflect.apply(GObject.getProperty, undefined, [object, name]);
|
|
234
221
|
return value;
|
|
235
222
|
}
|
|
236
223
|
function classEntries(entry) {
|
|
@@ -453,11 +440,12 @@ function toHaveRole(received, expected) {
|
|
|
453
440
|
}
|
|
454
441
|
function toContainElement(received, descendant) {
|
|
455
442
|
const widget = asWidget(received, "toContainElement");
|
|
456
|
-
const
|
|
443
|
+
const target = descendant === null ? null : asWidget(descendant, "toContainElement");
|
|
444
|
+
const isPass = target !== null && (target === widget || target.isAncestor(widget));
|
|
457
445
|
return {
|
|
458
446
|
pass: isPass,
|
|
459
447
|
message: () => `expected widget ${negationPrefix(isPass)}to contain ` +
|
|
460
|
-
`${
|
|
448
|
+
`${target === null ? "null" : describeWidget(target)}\n${describeWidget(widget)}`,
|
|
461
449
|
};
|
|
462
450
|
}
|
|
463
451
|
function toHaveClass(received, ...args) {
|
package/dist/matchers.js.map
CHANGED
|
@@ -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,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AAqB,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 camelCase = (name: string): string =>\n name.replaceAll(/-([a-z])/g, (_match, letter: string) => letter.toUpperCase());\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 assertReadableProperty(object: GObject.Object, name: string, property: string, value: unknown): void {\n if (typeof value === \"function\") {\n throw new TypeError(\n `toHaveObjectProperty: \"${name}\" is shadowed by a method of the same name; ` +\n `call ${property}() and assert on its result instead`,\n );\n }\n\n if (value === undefined && !Reflect.has(object, property)) {\n throw new TypeError(\n `toHaveObjectProperty: no readable property \"${name}\" on ${describeObject(object)}; ` +\n \"construct-only and write-only properties cannot be read back\",\n );\n }\n}\n\nfunction readObjectProperty(object: GObject.Object, name: string): unknown {\n const property = camelCase(name);\n const value: unknown = Reflect.get(object, property);\n assertReadableProperty(object, name, property, value);\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,OAA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Ac,CAAC,MAAM,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;AA4DF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAwE,CAAC","sourcesContent":["import type { SyncMatcherResult } from \"vitest\";\nimport * as GObject from \"@gtkx/gi/gobject\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ByRoleOptions, Matcher, MatcherOptions } from \"./types.js\";\nimport {\n ACCESSIBLE_NUMBER_TOLERANCE,\n type AccessibleAttributeValue,\n isAccessibleNumberMatch,\n isAccessibleNumberProperty,\n readAccessibleProperty,\n readAccessibleState,\n} from \"./accessible-native.js\";\nimport { getDefaultNormalizer } from \"./normalize.js\";\nimport {\n queryAllByDisplayValue,\n queryAllByLabelText,\n queryAllByPlaceholderText,\n queryAllByRole,\n queryAllByText,\n} from \"./queries.js\";\nimport { formatRole } from \"./role-helpers.js\";\nimport { type Container, descendants } from \"./traversal.js\";\nimport {\n type CheckedState,\n getWidgetAccessibleName,\n getWidgetCheckedState,\n getWidgetDescribedByText,\n getWidgetDisplayValue,\n getWidgetErrorMessage,\n getWidgetInvalidState,\n getWidgetLabelText,\n getWidgetPressedState,\n getWidgetRequiredState,\n getWidgetSelection,\n getWidgetTextContent,\n getWidgetValueNow,\n hasDisplayValue,\n isWidgetDisabled,\n isWidgetValueMatch,\n isWidgetVisible,\n} from \"./widget-accessible-properties.js\";\nimport { getTypeTag } from \"./widget-getters.js\";\nimport { isWindowActivated } from \"./window-state.js\";\n\n/** The expected value for a text matcher: an exact string or a regular expression. */\ntype TextExpectation = string | RegExp;\n\n/** Options controlling how `toHaveTextContent` normalizes the text it reads. */\ntype TextContentOptions = {\n /**\n * When true (the default), trim the text and collapse runs of whitespace into single spaces\n * before comparing. When false, only replace non-breaking spaces with regular ones.\n */\n normalizeWhitespace?: boolean | undefined;\n};\n\n/** The expected value for a style class: an exact class name or a regular expression. */\ntype ClassExpectation = string | RegExp;\n/** The outcome of a matcher: whether it passed, and the failure text built on demand. */\ntype MatcherResult = Pick<SyncMatcherResult, \"message\" | \"pass\">;\n\n/** The matcher state bound as `this`, supplying the test runner's deep equality check. */\ntype MatcherContext = {\n /** Compares a received value against an expected one, resolving asymmetric matchers. */\n equals: (actual: unknown, expected: unknown) => boolean;\n};\n\n/** Compares text read from the received widget; with no expected value, asserts the text is non-empty. */\ntype TextMatcher = (received: unknown, expected?: TextExpectation) => MatcherResult;\n/** Asserts a single state of the received widget, taking no expected value. */\ntype StateMatcher = (received: unknown) => MatcherResult;\n/** Trailing arguments of the `ByRole` query family, as a containment matcher takes them. */\ntype RoleQueryArgs = [role: Gtk.AccessibleRole, options?: ByRoleOptions];\n/** Trailing arguments of the text-based query families, as a containment matcher takes them. */\ntype TextQueryArgs = [text: Matcher, options?: MatcherOptions];\n/** Counts the descendants a query family finds under the received widget. */\ntype ContainmentMatcher<Args extends unknown[]> = (received: unknown, ...args: Args) => MatcherResult;\ntype TextMatcherContext = { matcherName: string; widget: Gtk.Widget; actual: string | null };\ntype ClassArguments = { expected: ClassExpectation[]; isExact: boolean };\ntype QueryAll<Args extends unknown[]> = (container: Container, ...args: Args) => object[];\n\ntype BooleanAccessibleState =\n Gtk.AccessibleState.BUSY |\n Gtk.AccessibleState.DISABLED |\n Gtk.AccessibleState.EXPANDED |\n Gtk.AccessibleState.HIDDEN |\n Gtk.AccessibleState.SELECTED |\n Gtk.AccessibleState.VISITED;\n\ntype TristateAccessibleState = Gtk.AccessibleState.CHECKED | Gtk.AccessibleState.PRESSED;\n\ntype StringAccessibleProperty =\n Gtk.AccessibleProperty.DESCRIPTION |\n Gtk.AccessibleProperty.HELP_TEXT |\n Gtk.AccessibleProperty.KEY_SHORTCUTS |\n Gtk.AccessibleProperty.LABEL |\n Gtk.AccessibleProperty.PLACEHOLDER |\n Gtk.AccessibleProperty.ROLE_DESCRIPTION |\n Gtk.AccessibleProperty.VALUE_TEXT;\n\ntype BooleanAccessibleProperty =\n Gtk.AccessibleProperty.HAS_POPUP |\n Gtk.AccessibleProperty.MODAL |\n Gtk.AccessibleProperty.MULTI_LINE |\n Gtk.AccessibleProperty.MULTI_SELECTABLE |\n Gtk.AccessibleProperty.READ_ONLY |\n Gtk.AccessibleProperty.REQUIRED;\n\ntype NumberAccessibleProperty =\n Gtk.AccessibleProperty.LEVEL |\n Gtk.AccessibleProperty.VALUE_MAX |\n Gtk.AccessibleProperty.VALUE_MIN |\n Gtk.AccessibleProperty.VALUE_NOW;\n\n/** A text matcher that also takes normalization options for the text it reads. */\ntype TextContentMatcher = (\n received: unknown,\n expected?: TextExpectation,\n options?: TextContentOptions,\n) => MatcherResult;\n\n/** Signatures of the widget assertion matchers, keyed by the name each is registered under. */\ntype MatcherImplementations = {\n /** Asserts the text an editable widget or combo box shows; with no argument, that it is not empty. */\n toHaveDisplayValue: TextMatcher;\n /** Asserts the widget's own text, or its descendants' when it has none, contains or matches the expectation. */\n toHaveTextContent: TextContentMatcher;\n /** Asserts the widget's accessible name; with no argument, that it has one. */\n toHaveAccessibleName: TextMatcher;\n /**\n * Asserts the joined accessible names of the widget's `described-by` targets, falling back to its\n * `description` and then to its tooltip.\n */\n toHaveAccessibleDescription: TextMatcher;\n /** Asserts the joined accessible names of the widget's `error-message` targets, read only while it is invalid. */\n toHaveAccessibleErrorMessage: TextMatcher;\n /** Asserts the text currently selected in an editable widget. */\n toHaveSelection: TextMatcher;\n /**\n * Asserts an accessible state GTK holds for the widget, taking the value type that state carries.\n * With no expected value, asserts only that the state is set to something determinate.\n */\n toHaveAccessibleState: (\n received: unknown,\n state: Gtk.AccessibleState,\n expected?: boolean | number,\n ) => MatcherResult;\n /**\n * Asserts an accessible property GTK holds for the widget, taking the value type that property\n * carries. With no expected value, asserts only that the property is set. Numeric properties\n * compare the way `toHaveValue` and the `value` option of the `ByRole` queries do, within 0.001.\n */\n toHaveAccessibleProperty: (\n received: unknown,\n property: Gtk.AccessibleProperty,\n expected?: AccessibleAttributeValue,\n ) => MatcherResult;\n /** Asserts the widget's checked state is checked rather than unchecked or mixed. */\n toBeChecked: StateMatcher;\n /** Asserts the widget's checked state is mixed. */\n toBePartiallyChecked: StateMatcher;\n /** Asserts a `Gtk.ToggleButton` is active, and throws for any other widget. */\n toBePressed: StateMatcher;\n /** Asserts the widget's accessible pressed state is mixed, and throws when it exposes none. */\n toBePartiallyPressed: StateMatcher;\n /** Asserts the widget is insensitive, or sits inside an insensitive ancestor. */\n toBeDisabled: StateMatcher;\n /** Asserts the widget and all of its ancestors are sensitive. */\n toBeEnabled: StateMatcher;\n /** Asserts the widget and its ancestors are all visible, and that none of them is fully transparent. */\n toBeVisible: StateMatcher;\n /** Asserts the widget's root is a window that is still in the toplevel list. */\n toBeRooted: StateMatcher;\n /** Asserts the widget has neither a child nor label text. */\n toBeEmptyWidget: StateMatcher;\n /** Asserts the widget's accessible invalid state is set to anything other than false. */\n toBeInvalid: StateMatcher;\n /** Asserts the widget's accessible invalid state is unset or false. */\n toBeValid: StateMatcher;\n /** Asserts the widget's accessible required state. */\n toBeRequired: StateMatcher;\n /** Asserts the widget holds the platform focus state. */\n toHaveFocus: StateMatcher;\n /**\n * Asserts a widget's numeric value, or its display value when a string is given.\n *\n * Numbers come from the accessibility tree, which GTK keeps to a resolution of 0.001: it drops an\n * update whose value is nearer than that to the one already published, so a widget that moves by\n * less keeps its previous value. Numbers therefore match within 0.001, the same tolerance the\n * `value` option of the `ByRole` queries and `toHaveAccessibleProperty` apply. That option reads\n * the same tree, where the maximum of a paged widget such as a scrollbar is the last value it can\n * reach, its adjustment's upper bound less one page.\n */\n toHaveValue: (received: unknown, expected?: number | string) => MatcherResult;\n /** Asserts the widget's accessible role. */\n toHaveRole: (received: unknown, expected: Gtk.AccessibleRole) => MatcherResult;\n /** Asserts the widget is, or is an ancestor of, the given widget. */\n toContainElement: (received: unknown, descendant: Gtk.Accessible | null) => MatcherResult;\n /** Asserts the widget comes before the given widget in the widget tree, neither containing the other. */\n toAppearBefore: (received: unknown, other: Gtk.Accessible) => MatcherResult;\n /** Asserts the widget comes after the given widget in the widget tree, neither containing the other. */\n toAppearAfter: (received: unknown, other: Gtk.Accessible) => MatcherResult;\n /** Asserts at least one widget under the received one matches the `ByRole` query. */\n toContainAnyByRole: ContainmentMatcher<RoleQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByRole` query. */\n toContainOneByRole: ContainmentMatcher<RoleQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByText` query. */\n toContainAnyByText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByText` query. */\n toContainOneByText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByLabelText` query. */\n toContainAnyByLabelText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByLabelText` query. */\n toContainOneByLabelText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByPlaceholderText` query. */\n toContainAnyByPlaceholderText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByPlaceholderText` query. */\n toContainOneByPlaceholderText: ContainmentMatcher<TextQueryArgs>;\n /** Asserts at least one widget under the received one matches the `ByDisplayValue` query. */\n toContainAnyByDisplayValue: ContainmentMatcher<TextQueryArgs>;\n /** Asserts exactly one widget under the received one matches the `ByDisplayValue` query. */\n toContainOneByDisplayValue: ContainmentMatcher<TextQueryArgs>;\n /**\n * Asserts the widget carries every given style class, each a name, a space-separated list, or a pattern.\n * Pass `{ exact: true }` last to require exactly that set, which rules out patterns.\n */\n toHaveClass: (received: unknown, ...args: unknown[]) => MatcherResult;\n /**\n * Asserts a GObject property, named as in GObject and looked up by its camel-cased accessor, equals the\n * expected value. With no expected value, asserts the property is set. GObject values compare by identity.\n */\n toHaveObjectProperty: (this: MatcherContext, received: unknown, ...args: unknown[]) => MatcherResult;\n};\n\ntype ExpectExtend = { extend: (m: MatcherImplementations) => void };\n\ntype AttributeExpectation = {\n label: string;\n comparison: string;\n expected: AccessibleAttributeValue;\n actual: AccessibleAttributeValue | null;\n isPass: boolean;\n isReadingRounded: boolean;\n};\n\nconst registration = { isRegistered: false };\nconst MIXED_TRISTATE: number = Gtk.AccessibleTristate.MIXED;\nconst ROUNDED_READING = \", which the accessibility tree rounds to six significant digits\";\nconst displayValueMatcher: TextMatcher = textMatcher(\"toHaveDisplayValue\", getWidgetDisplayValue, \"exact\");\nconst toHaveAccessibleName: TextMatcher = textMatcher(\"toHaveAccessibleName\", getWidgetAccessibleName, \"exact\");\n\nconst toHaveAccessibleDescription: TextMatcher = textMatcher(\n \"toHaveAccessibleDescription\",\n getWidgetDescribedByText,\n \"exact\",\n);\n\nconst toHaveAccessibleErrorMessage: TextMatcher = textMatcher(\n \"toHaveAccessibleErrorMessage\",\n readErrorMessageText,\n \"exact\",\n);\n\nconst toHaveSelection: TextMatcher = textMatcher(\"toHaveSelection\", getWidgetSelection, \"exact\");\nconst toBePressed: StateMatcher = booleanStateMatcher(\"toBePressed\", \"pressed\", getWidgetPressedState);\nconst toBeRequired: StateMatcher = booleanStateMatcher(\"toBeRequired\", \"required\", getWidgetRequiredState);\n\nconst toContainAnyByRole: ContainmentMatcher<RoleQueryArgs> = containmentMatcher(\n \"toContainAnyByRole\",\n false,\n queryAllByRole,\n);\n\nconst toContainOneByRole: ContainmentMatcher<RoleQueryArgs> = containmentMatcher(\n \"toContainOneByRole\",\n true,\n queryAllByRole,\n);\n\nconst toContainAnyByText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByText\",\n false,\n queryAllByText,\n);\n\nconst toContainOneByText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByText\",\n true,\n queryAllByText,\n);\n\nconst toContainAnyByLabelText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByLabelText\",\n false,\n queryAllByLabelText,\n);\n\nconst toContainOneByLabelText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByLabelText\",\n true,\n queryAllByLabelText,\n);\n\nconst toContainAnyByPlaceholderText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByPlaceholderText\",\n false,\n queryAllByPlaceholderText,\n);\n\nconst toContainOneByPlaceholderText: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByPlaceholderText\",\n true,\n queryAllByPlaceholderText,\n);\n\nconst toContainAnyByDisplayValue: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainAnyByDisplayValue\",\n false,\n queryAllByDisplayValue,\n);\n\nconst toContainOneByDisplayValue: ContainmentMatcher<TextQueryArgs> = containmentMatcher(\n \"toContainOneByDisplayValue\",\n true,\n queryAllByDisplayValue,\n);\n\n/** The widget assertion matchers keyed by name, suitable for passing to `expect.extend`. */\nconst matchers: MatcherImplementations = {\n toHaveDisplayValue,\n toHaveTextContent,\n toHaveAccessibleName,\n toHaveAccessibleDescription,\n toHaveAccessibleErrorMessage,\n toHaveSelection,\n toHaveAccessibleState,\n toHaveAccessibleProperty,\n toBeChecked,\n toBePartiallyChecked,\n toBePressed,\n toBePartiallyPressed,\n toBeDisabled,\n toBeEnabled,\n toBeVisible,\n toBeRooted,\n toBeEmptyWidget,\n toBeInvalid,\n toBeValid,\n toBeRequired,\n toHaveFocus,\n toHaveValue,\n toHaveRole,\n toContainElement,\n toAppearBefore,\n toAppearAfter,\n toContainAnyByRole,\n toContainOneByRole,\n toContainAnyByText,\n toContainOneByText,\n toContainAnyByLabelText,\n toContainOneByLabelText,\n toContainAnyByPlaceholderText,\n toContainOneByPlaceholderText,\n toContainAnyByDisplayValue,\n toContainOneByDisplayValue,\n toHaveClass,\n toHaveObjectProperty,\n};\n\nconst asWidget = (received: unknown, matcherName: string): Gtk.Widget => {\n if (!(received instanceof Gtk.Widget)) {\n throw new TypeError(`${matcherName}: received value must be a Gtk.Widget, got ${typeof received}`);\n }\n\n return received;\n};\n\nconst asObject = (received: unknown, matcherName: string): GObject.Object => {\n if (!(received instanceof GObject.Object)) {\n throw new TypeError(`${matcherName}: received value must be a GObject, got ${typeof received}`);\n }\n\n return received;\n};\n\nconst describeWidget = (widget: Gtk.Widget): string => {\n const role = Gtk.AccessibleRole[widget.getAccessibleRole()];\n const name = getWidgetAccessibleName(widget);\n\n return name === null ? `<${role}>` : `<${role} name=${JSON.stringify(name)}>`;\n};\n\nconst describeObject = (object: GObject.Object): string =>\n object instanceof Gtk.Widget ? describeWidget(object) : `<${getTypeTag(object)}>`;\n\nconst isTextMatch = (actual: string, expected: TextExpectation, mode: \"exact\" | \"substring\"): boolean => {\n if (expected instanceof RegExp) {\n expected.lastIndex = 0;\n\n return expected.test(actual);\n }\n\n return mode === \"exact\" ? actual === expected : actual.includes(expected);\n};\n\nconst describeExpected = (expected: TextExpectation): string =>\n expected instanceof RegExp ? String(expected) : JSON.stringify(expected);\n\nconst negationPrefix = (isPass: boolean): string => (isPass ? \"not \" : \"\");\n\nconst nonEmptyResult = ({ matcherName, widget, actual }: TextMatcherContext): MatcherResult => {\n const isPass = actual !== null && actual !== \"\";\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have a non-empty value for ${matcherName}, ` +\n `but got ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n};\n\nconst matchedResult = (context: TextMatcherContext, expected: TextExpectation, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}${context.matcherName} ${describeExpected(expected)}, ` +\n `but received ${JSON.stringify(context.actual)}\\n${describeWidget(context.widget)}`,\n});\n\nconst stateResult = (widget: Gtk.Widget, stateName: string, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () => `expected widget ${negationPrefix(isPass)}to be ${stateName}\\n${describeWidget(widget)}`,\n});\n\nconst isHoldingFocus = (widget: Gtk.Widget, root: Gtk.Window): boolean => {\n const focus = root.getFocus();\n\n return focus !== null && (focus === widget || focus.isAncestor(widget));\n};\n\nconst isFocusHeldByInactiveWindow = (widget: Gtk.Widget): boolean => {\n const root = widget.getRoot();\n\n return root instanceof Gtk.Window && !isWindowActivated(root) && isHoldingFocus(widget, root);\n};\n\nconst focusResult = (widget: Gtk.Widget, isPass: boolean): MatcherResult => {\n if (isPass || !isFocusHeldByInactiveWindow(widget)) {\n return stateResult(widget, \"focused\", isPass);\n }\n\n return {\n pass: false,\n message: () =>\n \"expected widget to be focused: its window has given it the focus, \" +\n `but that window is not active\\n${describeWidget(widget)}`,\n };\n};\n\nconst describeAttributeValue = (value: AccessibleAttributeValue | null): string =>\n value === null ? \"unset\" : JSON.stringify(value);\n\nconst attributeSetResult = (\n widget: Gtk.Widget,\n label: string,\n actual: AccessibleAttributeValue | null,\n): MatcherResult => {\n const isSet = actual !== null;\n\n return {\n pass: isSet,\n message: () => `expected widget ${negationPrefix(isSet)}to have ${label} set\\n${describeWidget(widget)}`,\n };\n};\n\nconst describeReading = (expectation: AttributeExpectation): string =>\n `${describeAttributeValue(expectation.actual)}${expectation.isReadingRounded ? ROUNDED_READING : \"\"}`;\n\nconst attributeValueResult = (widget: Gtk.Widget, expectation: AttributeExpectation): MatcherResult => ({\n pass: expectation.isPass,\n message: () =>\n `expected widget ${negationPrefix(expectation.isPass)}to have ${expectation.label} ` +\n `${expectation.comparison} ${describeAttributeValue(expectation.expected)}, but received ` +\n `${describeReading(expectation)}\\n${describeWidget(widget)}`,\n});\n\nconst orderResult = (widget: Gtk.Widget, other: Gtk.Widget, position: string, isPass: boolean): MatcherResult => ({\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to appear ${position} ${describeWidget(other)} ` +\n `in the widget tree\\n${describeWidget(widget)}`,\n});\n\nconst getTreeRoot = (widget: Gtk.Widget): Gtk.Widget => {\n let root = widget;\n let parent = root.getParent();\n\n while (parent) {\n root = parent;\n parent = root.getParent();\n }\n\n return root;\n};\n\nconst isSeparateWidget = (first: Gtk.Widget, second: Gtk.Widget): boolean =>\n first !== second && !first.isAncestor(second) && !second.isAncestor(first);\n\nconst isPrecedingWidget = (root: Gtk.Widget, first: Gtk.Widget, second: Gtk.Widget): boolean => {\n for (const widget of descendants(root)) {\n if (widget === first) {\n return true;\n }\n\n if (widget === second) {\n return false;\n }\n }\n\n return false;\n};\n\nconst isAppearingBefore = (first: Gtk.Widget, second: Gtk.Widget): boolean => {\n const root = getTreeRoot(first);\n\n return isSeparateWidget(first, second) && root === getTreeRoot(second) && isPrecedingWidget(root, first, second);\n};\n\nconst isAsymmetricMatcher = (value: unknown): boolean =>\n typeof value === \"object\" && value !== null && typeof Reflect.get(value, \"asymmetricMatch\") === \"function\";\n\nconst isEqualValue = (context: MatcherContext, actual: unknown, expected: unknown): boolean => {\n if (isAsymmetricMatcher(expected)) {\n return context.equals(actual, expected);\n }\n\n if (actual instanceof GObject.Object || expected instanceof GObject.Object) {\n return Object.is(actual, expected);\n }\n\n return context.equals(actual, expected);\n};\n\nconst isClassMatch = (actual: string[], expected: ClassExpectation): boolean =>\n expected instanceof RegExp ? actual.some((name) => expected.test(name)) : actual.includes(expected);\n\nconst isWidgetRooted = (widget: Gtk.Widget): boolean => {\n const root = widget.getRoot();\n\n if (root === null) {\n return false;\n }\n\n if (root instanceof Gtk.Window) {\n return Gtk.Window.listToplevels().includes(root);\n }\n\n return true;\n};\n\nconst globalExpect = (): ExpectExtend | null => {\n const candidate: unknown = Reflect.get(globalThis, \"expect\");\n\n if (candidate && typeof (candidate as ExpectExtend).extend === \"function\") {\n return candidate as ExpectExtend;\n }\n\n return null;\n};\n\nfunction readErrorMessageText(widget: Gtk.Widget): string | null {\n const state = getWidgetInvalidState(widget);\n\n if (state === null || state === Gtk.AccessibleInvalidState.FALSE) {\n return null;\n }\n\n const targets = getWidgetErrorMessage(widget);\n\n if (targets === null) {\n return null;\n }\n\n const texts = targets.map((target) => getWidgetAccessibleName(target)).filter((text) => text !== null);\n\n return texts.length > 0 ? texts.join(\" \") : null;\n}\n\nfunction readObjectProperty(object: GObject.Object, name: string): unknown {\n const value: unknown = Reflect.apply(GObject.getProperty, undefined, [object, name]);\n\n return value;\n}\n\nfunction classEntries(entry: unknown): ClassExpectation[] {\n return entry instanceof RegExp ? [entry] : String(entry).split(/\\s+/).filter(Boolean);\n}\n\nfunction parseClassArguments(args: unknown[]): ClassArguments {\n const last = args.at(-1);\n const isOptions = typeof last === \"object\" && last !== null && !(last instanceof RegExp);\n const isExact = isOptions && Reflect.get(last, \"exact\") === true;\n const entries = isOptions ? args.slice(0, -1) : args;\n\n return { expected: entries.flatMap((entry) => classEntries(entry)), isExact };\n}\n\nfunction exactClassResult(widget: Gtk.Widget, actual: string[], expected: ClassExpectation[]): MatcherResult {\n if (expected.some((entry) => entry instanceof RegExp)) {\n throw new TypeError(\"toHaveClass: the exact option cannot be combined with a regular expression\");\n }\n\n const names = expected.map(String);\n const isPass = names.length === actual.length && names.every((name) => actual.includes(name));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have exactly the classes ${JSON.stringify(names)}, ` +\n `but received ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction textMatcher(\n matcherName: string,\n read: (widget: Gtk.Widget) => string | null,\n mode: \"exact\" | \"substring\",\n): TextMatcher {\n return (received: unknown, expected?: TextExpectation): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const actual = read(widget);\n const context: TextMatcherContext = { matcherName, widget, actual };\n\n if (expected === undefined) {\n return nonEmptyResult(context);\n }\n\n return matchedResult(context, expected, actual !== null && isTextMatch(actual, expected, mode));\n };\n}\n\nfunction normalizeTextContent(text: string, options?: TextContentOptions): string {\n if (options?.normalizeWhitespace === false) {\n return text.replaceAll(\"\\u{A0}\", \" \");\n }\n\n return getDefaultNormalizer()(text);\n}\n\nfunction readTextContent(widget: Gtk.Widget, options?: TextContentOptions): string | null {\n const text = getWidgetTextContent(widget);\n\n return text === null ? null : normalizeTextContent(text, options);\n}\n\nfunction toHaveTextContent(\n received: unknown,\n expected?: TextExpectation,\n options?: TextContentOptions,\n): MatcherResult {\n const read = (widget: Gtk.Widget): string | null => readTextContent(widget, options);\n\n return textMatcher(\"toHaveTextContent\", read, \"substring\")(received, expected);\n}\n\nfunction notApplicable(matcherName: string, stateName: string, widget: Gtk.Widget): Error {\n return new Error(\n `${matcherName}: widget does not expose a ${stateName} ` +\n `(role ${Gtk.AccessibleRole[widget.getAccessibleRole()]})\\n${describeWidget(widget)}`,\n );\n}\n\nfunction booleanStateMatcher(\n matcherName: string,\n stateName: string,\n read: (widget: Gtk.Widget) => boolean | null,\n): StateMatcher {\n return (received: unknown): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const state = read(widget);\n\n if (state === null) {\n throw notApplicable(matcherName, `${stateName} state`, widget);\n }\n\n return stateResult(widget, stateName, state);\n };\n}\n\nfunction containmentMatcher<Args extends unknown[]>(\n matcherName: string,\n isSingle: boolean,\n queryAll: QueryAll<Args>,\n): ContainmentMatcher<Args> {\n const quantity = isSingle ? \"exactly one widget\" : \"any widget\";\n\n return (received: unknown, ...args: Args): MatcherResult => {\n const widget = asWidget(received, matcherName);\n const matches = queryAll(widget, ...args);\n const isPass = isSingle ? matches.length === 1 : matches.length > 0;\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to contain ${quantity} matching ${matcherName}, ` +\n `but found ${String(matches.length)}\\n${describeWidget(widget)}`,\n };\n };\n}\n\nfunction toHaveAccessibleState(\n received: unknown,\n state: Gtk.AccessibleState,\n expected?: boolean | number,\n): MatcherResult {\n const widget = asWidget(received, \"toHaveAccessibleState\");\n const actual = readAccessibleState(widget, state);\n const label = `accessible state ${Gtk.AccessibleState[state]}`;\n\n if (expected === undefined) {\n return attributeSetResult(widget, label, actual);\n }\n\n const wanted = typeof expected === \"boolean\" ? Number(expected) : expected;\n\n return attributeValueResult(widget, {\n label,\n comparison: \"equal to\",\n expected: wanted,\n actual,\n isPass: actual === wanted,\n isReadingRounded: false,\n });\n}\n\nconst propertyLabel = (property: Gtk.AccessibleProperty): string =>\n `accessible property ${Gtk.AccessibleProperty[property]}`;\n\nconst propertyExpectation = (\n widget: Gtk.Widget,\n property: Gtk.AccessibleProperty,\n expected: AccessibleAttributeValue,\n actual: AccessibleAttributeValue | null,\n): AttributeExpectation => {\n const label = propertyLabel(property);\n\n if (typeof expected === \"number\" && isAccessibleNumberProperty(property)) {\n return {\n label,\n comparison: `within ${String(ACCESSIBLE_NUMBER_TOLERANCE)} of`,\n expected,\n actual,\n isPass: isAccessibleNumberMatch(widget, property, expected),\n isReadingRounded: actual !== null,\n };\n }\n\n return { label, comparison: \"equal to\", expected, actual, isPass: actual === expected, isReadingRounded: false };\n};\n\nfunction toHaveAccessibleProperty(\n received: unknown,\n property: Gtk.AccessibleProperty,\n expected?: AccessibleAttributeValue,\n): MatcherResult {\n const widget = asWidget(received, \"toHaveAccessibleProperty\");\n const actual = readAccessibleProperty(widget, property);\n\n if (expected === undefined) {\n return attributeSetResult(widget, propertyLabel(property), actual);\n }\n\n return attributeValueResult(widget, propertyExpectation(widget, property, expected, actual));\n}\n\nfunction toBePartiallyPressed(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBePartiallyPressed\");\n const state = readAccessibleState(widget, Gtk.AccessibleState.PRESSED);\n\n if (state === null) {\n throw notApplicable(\"toBePartiallyPressed\", \"pressed state\", widget);\n }\n\n return stateResult(widget, \"partially pressed\", state === MIXED_TRISTATE);\n}\n\nfunction toAppearBefore(received: unknown, other: Gtk.Accessible): MatcherResult {\n const widget = asWidget(received, \"toAppearBefore\");\n const target = asWidget(other, \"toAppearBefore\");\n\n return orderResult(widget, target, \"before\", isAppearingBefore(widget, target));\n}\n\nfunction toAppearAfter(received: unknown, other: Gtk.Accessible): MatcherResult {\n const widget = asWidget(received, \"toAppearAfter\");\n const target = asWidget(other, \"toAppearAfter\");\n\n return orderResult(widget, target, \"after\", isAppearingBefore(target, widget));\n}\n\nfunction readCheckedState(widget: Gtk.Widget, matcherName: string): CheckedState {\n const state = getWidgetCheckedState(widget);\n\n if (state === null) {\n throw notApplicable(matcherName, \"checked state\", widget);\n }\n\n return state;\n}\n\nfunction toBeChecked(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeChecked\");\n\n return stateResult(widget, \"checked\", readCheckedState(widget, \"toBeChecked\") === \"checked\");\n}\n\nfunction toBePartiallyChecked(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBePartiallyChecked\");\n\n return stateResult(widget, \"partially checked\", readCheckedState(widget, \"toBePartiallyChecked\") === \"mixed\");\n}\n\nfunction toHaveDisplayValue(received: unknown, expected?: TextExpectation): MatcherResult {\n const widget = asWidget(received, \"toHaveDisplayValue\");\n\n if (!hasDisplayValue(widget)) {\n throw notApplicable(\"toHaveDisplayValue\", \"display value\", widget);\n }\n\n return displayValueMatcher(received, expected);\n}\n\nconst describeValueExpectation = (expected: number | undefined): string =>\n expected === undefined ? \"set\" : `within ${String(ACCESSIBLE_NUMBER_TOLERANCE)} of ${String(expected)}`;\n\nfunction toHaveValue(received: unknown, expected?: number | string): MatcherResult {\n const widget = asWidget(received, \"toHaveValue\");\n\n if (typeof expected === \"string\") {\n return displayValueMatcher(received, expected);\n }\n\n const actual = getWidgetValueNow(widget);\n\n if (actual === null) {\n throw notApplicable(\"toHaveValue\", \"numeric value\", widget);\n }\n\n const isPass = expected === undefined || isWidgetValueMatch(widget, \"now\", expected);\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have value ${describeValueExpectation(expected)}, ` +\n `but received ${String(actual)}${ROUNDED_READING}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toBeDisabled(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeDisabled\");\n\n return stateResult(widget, \"disabled\", isWidgetDisabled(widget));\n}\n\nfunction toBeEnabled(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeEnabled\");\n\n return stateResult(widget, \"enabled\", !isWidgetDisabled(widget));\n}\n\nfunction toBeVisible(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeVisible\");\n\n return stateResult(widget, \"visible\", isWidgetVisible(widget));\n}\n\nfunction toBeRooted(received: unknown): MatcherResult {\n if (received === null) {\n return { pass: false, message: () => \"expected a widget to be rooted in a window, but received null\" };\n }\n\n const widget = asWidget(received, \"toBeRooted\");\n\n return stateResult(widget, \"rooted in a window\", isWidgetRooted(widget));\n}\n\nfunction toBeEmptyWidget(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeEmptyWidget\");\n\n return stateResult(widget, \"empty\", widget.getFirstChild() === null && getWidgetLabelText(widget) === null);\n}\n\nfunction toBeInvalid(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeInvalid\");\n const state = getWidgetInvalidState(widget);\n\n return stateResult(widget, \"invalid\", state !== null && state !== Gtk.AccessibleInvalidState.FALSE);\n}\n\nfunction toBeValid(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toBeValid\");\n const state = getWidgetInvalidState(widget);\n\n return stateResult(widget, \"valid\", state === null || state === Gtk.AccessibleInvalidState.FALSE);\n}\n\nfunction toHaveFocus(received: unknown): MatcherResult {\n const widget = asWidget(received, \"toHaveFocus\");\n\n return focusResult(widget, widget.getPlatformState(Gtk.AccessiblePlatformState.FOCUSED));\n}\n\nfunction toHaveRole(received: unknown, expected: Gtk.AccessibleRole): MatcherResult {\n const widget = asWidget(received, \"toHaveRole\");\n const actual = widget.getAccessibleRole();\n const isPass = actual === expected;\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have role '${formatRole(expected)}', ` +\n `but received '${formatRole(actual)}'\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toContainElement(received: unknown, descendant: Gtk.Accessible | null): MatcherResult {\n const widget = asWidget(received, \"toContainElement\");\n const target = descendant === null ? null : asWidget(descendant, \"toContainElement\");\n const isPass = target !== null && (target === widget || target.isAncestor(widget));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to contain ` +\n `${target === null ? \"null\" : describeWidget(target)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toHaveClass(received: unknown, ...args: unknown[]): MatcherResult {\n const widget = asWidget(received, \"toHaveClass\");\n const actual = widget.getCssClasses();\n const { expected, isExact } = parseClassArguments(args);\n\n if (isExact) {\n return exactClassResult(widget, actual, expected);\n }\n\n if (expected.length === 0) {\n return stateResult(widget, \"given any style class\", actual.length > 0);\n }\n\n const isPass = expected.every((entry) => isClassMatch(actual, entry));\n\n return {\n pass: isPass,\n message: () =>\n `expected widget ${negationPrefix(isPass)}to have class ${expected.map(String).join(\", \")}, ` +\n `but received ${JSON.stringify(actual)}\\n${describeWidget(widget)}`,\n };\n}\n\nfunction toHaveObjectProperty(this: MatcherContext, received: unknown, ...args: unknown[]): MatcherResult {\n const object = asObject(received, \"toHaveObjectProperty\");\n const [name, expected] = args;\n const actual = readObjectProperty(object, String(name));\n\n if (args.length < 2) {\n const isSet = actual !== null && actual !== undefined;\n\n return {\n pass: isSet,\n message: () =>\n `expected ${describeObject(object)} ${negationPrefix(isSet)}to have a value for property ` +\n `\"${String(name)}\", but received ${JSON.stringify(actual)}`,\n };\n }\n\n const isPass = isEqualValue(this, actual, expected);\n\n return {\n pass: isPass,\n message: () =>\n `expected ${describeObject(object)} ${negationPrefix(isPass)}to have property \"${String(name)}\" ` +\n `equal to ${JSON.stringify(expected)}, but received ${JSON.stringify(actual)}`,\n };\n}\n\n/** Registers the widget matchers on the global `expect`, when one is available. Safe to call more than once. */\nconst registerMatchers = (): void => {\n if (registration.isRegistered) {\n return;\n }\n\n const expect = globalExpect();\n\n if (!expect) {\n return;\n }\n\n expect.extend(matchers);\n registration.isRegistered = true;\n};\n\ndeclare module \"vitest\" {\n /* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars --\n declaration merging requires an interface with vitest's exact type parameters */\n interface Matchers<R extends void | Promise<void> = void | Promise<void>, T = unknown> {\n toHaveDisplayValue(expected?: TextExpectation): R;\n toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): R;\n toHaveAccessibleName(expected?: TextExpectation): R;\n toHaveAccessibleDescription(expected?: TextExpectation): R;\n toHaveAccessibleErrorMessage(expected?: TextExpectation): R;\n toHaveSelection(expected?: TextExpectation): R;\n /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */\n toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): R;\n toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): R;\n toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): R;\n toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): R;\n /* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */\n toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): R;\n toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): R;\n toHaveAccessibleProperty(\n property: Gtk.AccessibleProperty.AUTOCOMPLETE,\n expected?: Gtk.AccessibleAutocomplete,\n ): R;\n toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): R;\n toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): R;\n toBeChecked(): R;\n toBePartiallyChecked(): R;\n toBePressed(): R;\n toBePartiallyPressed(): R;\n toBeDisabled(): R;\n toBeEnabled(): R;\n toBeVisible(): R;\n toBeRooted(): R;\n toBeEmptyWidget(): R;\n toBeInvalid(): R;\n toBeValid(): R;\n toBeRequired(): R;\n toHaveFocus(): R;\n toHaveValue(expected?: number | string): R;\n toHaveRole(expected: Gtk.AccessibleRole): R;\n toContainElement(descendant: Gtk.Accessible | null): R;\n toAppearBefore(other: Gtk.Accessible): R;\n toAppearAfter(other: Gtk.Accessible): R;\n toContainAnyByRole(...args: RoleQueryArgs): R;\n toContainOneByRole(...args: RoleQueryArgs): R;\n toContainAnyByText(...args: TextQueryArgs): R;\n toContainOneByText(...args: TextQueryArgs): R;\n toContainAnyByLabelText(...args: TextQueryArgs): R;\n toContainOneByLabelText(...args: TextQueryArgs): R;\n toContainAnyByPlaceholderText(...args: TextQueryArgs): R;\n toContainOneByPlaceholderText(...args: TextQueryArgs): R;\n toContainAnyByDisplayValue(...args: TextQueryArgs): R;\n toContainOneByDisplayValue(...args: TextQueryArgs): R;\n toHaveClass(...args: (ClassExpectation | { exact: boolean })[]): R;\n toHaveObjectProperty(name: string, expected?: unknown): R;\n }\n /* eslint-enable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars */\n}\n\nexport { matchers, registerMatchers, type ClassExpectation, type TextContentOptions, type TextExpectation };\n"]}
|
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) =>
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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):
|
|
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
|