@gtkx/testing 1.6.0 → 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 +47 -44
- 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/config.d.ts.map +1 -1
- package/dist/config.js +1 -3
- package/dist/config.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 +37 -133
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +48 -136
- 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 +26 -8
- 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/adjustment.d.ts +2 -14
- package/dist/user-event/adjustment.d.ts.map +1 -1
- package/dist/user-event/adjustment.js +2 -14
- package/dist/user-event/adjustment.js.map +1 -1
- package/dist/user-event/click.d.ts +20 -45
- package/dist/user-event/click.d.ts.map +1 -1
- package/dist/user-event/click.js +31 -50
- 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/gesture.d.ts +9 -43
- package/dist/user-event/gesture.d.ts.map +1 -1
- package/dist/user-event/gesture.js +9 -43
- package/dist/user-event/gesture.js.map +1 -1
- package/dist/user-event/index.d.ts +38 -107
- package/dist/user-event/index.d.ts.map +1 -1
- package/dist/user-event/index.js +29 -30
- package/dist/user-event/index.js.map +1 -1
- package/dist/user-event/keyboard.d.ts +1 -1
- package/dist/user-event/keyboard.d.ts.map +1 -1
- package/dist/user-event/keyboard.js +24 -3
- 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 +4 -20
- package/dist/user-event/selection.d.ts.map +1 -1
- package/dist/user-event/selection.js +11 -23
- package/dist/user-event/selection.js.map +1 -1
- package/dist/user-event/text.d.ts +5 -34
- package/dist/user-event/text.d.ts.map +1 -1
- package/dist/user-event/text.js +5 -34
- package/dist/user-event/text.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 +38 -51
- 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 +17 -10
- package/src/accessible-native.ts +45 -9
- package/src/build-queries.ts +60 -30
- package/src/config.ts +1 -3
- package/src/fire-event.ts +32 -8
- package/src/matchers.ts +63 -85
- package/src/queries.ts +94 -156
- package/src/query-helpers.ts +17 -9
- package/src/render.tsx +7 -2
- package/src/role-helpers.ts +3 -1
- package/src/screenshot.ts +49 -8
- package/src/suggestions.ts +3 -1
- package/src/traversal.ts +35 -11
- package/src/types.ts +14 -10
- package/src/user-event/adjustment.ts +2 -14
- package/src/user-event/click.ts +40 -58
- package/src/user-event/controller.ts +8 -5
- package/src/user-event/gesture.ts +9 -43
- package/src/user-event/index.ts +149 -132
- package/src/user-event/keyboard.ts +33 -4
- package/src/user-event/list-row-click.ts +2 -2
- package/src/user-event/pointer.ts +11 -15
- package/src/user-event/selection.ts +15 -25
- package/src/user-event/text.ts +5 -34
- package/src/wait-for.ts +9 -6
- package/src/widget-accessible-properties.ts +61 -69
- package/src/widget-getters.ts +11 -13
- package/src/widget-target.ts +11 -0
package/src/fire-event.ts
CHANGED
|
@@ -7,13 +7,21 @@ import { runInAct } from "./act.js";
|
|
|
7
7
|
*/
|
|
8
8
|
type WidgetEvent = {
|
|
9
9
|
/** The GObject instance the signal is emitted on. */
|
|
10
|
-
target: GObject.Object
|
|
10
|
+
target: Pick<GObject.Object, "__type__">;
|
|
11
11
|
/** Name of the signal to emit. */
|
|
12
12
|
signalName: string;
|
|
13
13
|
/** Arguments passed to the signal handlers. */
|
|
14
14
|
args: unknown[];
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
const requireObject = (target: object): GObject.Object => {
|
|
18
|
+
if (!(target instanceof GObject.Object)) {
|
|
19
|
+
throw new TypeError("Expected a GObject instance");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return target;
|
|
23
|
+
};
|
|
24
|
+
|
|
17
25
|
/**
|
|
18
26
|
* Records a signal emission without delivering it, so it can be inspected or held and passed to
|
|
19
27
|
* {@link fireEvent} later.
|
|
@@ -23,18 +31,28 @@ type WidgetEvent = {
|
|
|
23
31
|
* @param args Arguments to pass to the signal handlers.
|
|
24
32
|
* @returns The recorded emission.
|
|
25
33
|
*/
|
|
26
|
-
const createEvent = (
|
|
27
|
-
target,
|
|
34
|
+
const createEvent = (
|
|
35
|
+
target: Pick<GObject.Object, "__type__">,
|
|
36
|
+
signalName: string,
|
|
37
|
+
...args: unknown[]
|
|
38
|
+
): WidgetEvent => ({
|
|
39
|
+
target: requireObject(target),
|
|
28
40
|
signalName,
|
|
29
41
|
args,
|
|
30
42
|
});
|
|
31
43
|
|
|
32
44
|
const dispatchEvent = async (event: WidgetEvent): Promise<void> => {
|
|
45
|
+
const target = requireObject(event.target);
|
|
46
|
+
|
|
33
47
|
await runInAct(() => {
|
|
34
|
-
|
|
48
|
+
Reflect.apply(GObject.signalEmit, undefined, [target, event.signalName, ...event.args]);
|
|
35
49
|
});
|
|
36
50
|
};
|
|
37
51
|
|
|
52
|
+
const isWidgetEvent = (value: object): value is WidgetEvent =>
|
|
53
|
+
"target" in value && "signalName" in value && "args" in value &&
|
|
54
|
+
typeof value.signalName === "string" && Array.isArray(value.args);
|
|
55
|
+
|
|
38
56
|
/**
|
|
39
57
|
* Emits a recorded signal emission inside React's act environment, so any resulting state updates are
|
|
40
58
|
* flushed before the promise resolves.
|
|
@@ -50,14 +68,18 @@ function fireEvent(event: WidgetEvent): Promise<void>;
|
|
|
50
68
|
* @param signalName Name of the signal to emit.
|
|
51
69
|
* @param args Arguments passed to the signal handlers.
|
|
52
70
|
*/
|
|
53
|
-
function fireEvent(
|
|
71
|
+
function fireEvent(
|
|
72
|
+
target: Pick<GObject.Object, "__type__">,
|
|
73
|
+
signalName: string,
|
|
74
|
+
...args: unknown[]
|
|
75
|
+
): Promise<void>;
|
|
54
76
|
|
|
55
77
|
function fireEvent(
|
|
56
|
-
eventOrTarget: WidgetEvent | GObject.Object,
|
|
78
|
+
eventOrTarget: WidgetEvent | Pick<GObject.Object, "__type__">,
|
|
57
79
|
signalName?: string,
|
|
58
80
|
...args: unknown[]
|
|
59
81
|
): Promise<void> {
|
|
60
|
-
if (
|
|
82
|
+
if (signalName === undefined && isWidgetEvent(eventOrTarget)) {
|
|
61
83
|
return dispatchEvent(eventOrTarget);
|
|
62
84
|
}
|
|
63
85
|
|
|
@@ -65,7 +87,9 @@ function fireEvent(
|
|
|
65
87
|
throw new Error("Unable to fire an event: pass a signal name, or an event built by createEvent.");
|
|
66
88
|
}
|
|
67
89
|
|
|
68
|
-
|
|
90
|
+
const target = requireObject(eventOrTarget);
|
|
91
|
+
|
|
92
|
+
return dispatchEvent({ target, signalName, args });
|
|
69
93
|
}
|
|
70
94
|
|
|
71
95
|
export { createEvent, fireEvent, type WidgetEvent };
|
package/src/matchers.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SyncMatcherResult } from "vitest";
|
|
2
2
|
import * as GObject from "@gtkx/gi/gobject";
|
|
3
3
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
4
4
|
import type { ByRoleOptions, Matcher, MatcherOptions } from "./types.js";
|
|
@@ -57,7 +57,7 @@ type TextContentOptions = {
|
|
|
57
57
|
/** The expected value for a style class: an exact class name or a regular expression. */
|
|
58
58
|
type ClassExpectation = string | RegExp;
|
|
59
59
|
/** The outcome of a matcher: whether it passed, and the failure text built on demand. */
|
|
60
|
-
type MatcherResult = Pick<
|
|
60
|
+
type MatcherResult = Pick<SyncMatcherResult, "message" | "pass">;
|
|
61
61
|
|
|
62
62
|
/** The matcher state bound as `this`, supplying the test runner's deep equality check. */
|
|
63
63
|
type MatcherContext = {
|
|
@@ -77,7 +77,7 @@ type TextQueryArgs = [text: Matcher, options?: MatcherOptions];
|
|
|
77
77
|
type ContainmentMatcher<Args extends unknown[]> = (received: unknown, ...args: Args) => MatcherResult;
|
|
78
78
|
type TextMatcherContext = { matcherName: string; widget: Gtk.Widget; actual: string | null };
|
|
79
79
|
type ClassArguments = { expected: ClassExpectation[]; isExact: boolean };
|
|
80
|
-
type QueryAll<Args extends unknown[]> = (container: Container, ...args: Args) =>
|
|
80
|
+
type QueryAll<Args extends unknown[]> = (container: Container, ...args: Args) => object[];
|
|
81
81
|
|
|
82
82
|
type BooleanAccessibleState =
|
|
83
83
|
Gtk.AccessibleState.BUSY |
|
|
@@ -195,11 +195,11 @@ type MatcherImplementations = {
|
|
|
195
195
|
/** Asserts the widget's accessible role. */
|
|
196
196
|
toHaveRole: (received: unknown, expected: Gtk.AccessibleRole) => MatcherResult;
|
|
197
197
|
/** Asserts the widget is, or is an ancestor of, the given widget. */
|
|
198
|
-
toContainElement: (received: unknown, descendant: Gtk.
|
|
198
|
+
toContainElement: (received: unknown, descendant: Gtk.Accessible | null) => MatcherResult;
|
|
199
199
|
/** Asserts the widget comes before the given widget in the widget tree, neither containing the other. */
|
|
200
|
-
toAppearBefore: (received: unknown, other: Gtk.
|
|
200
|
+
toAppearBefore: (received: unknown, other: Gtk.Accessible) => MatcherResult;
|
|
201
201
|
/** Asserts the widget comes after the given widget in the widget tree, neither containing the other. */
|
|
202
|
-
toAppearAfter: (received: unknown, other: Gtk.
|
|
202
|
+
toAppearAfter: (received: unknown, other: Gtk.Accessible) => MatcherResult;
|
|
203
203
|
/** Asserts at least one widget under the received one matches the `ByRole` query. */
|
|
204
204
|
toContainAnyByRole: ContainmentMatcher<RoleQueryArgs>;
|
|
205
205
|
/** Asserts exactly one widget under the received one matches the `ByRole` query. */
|
|
@@ -525,9 +525,6 @@ const isAppearingBefore = (first: Gtk.Widget, second: Gtk.Widget): boolean => {
|
|
|
525
525
|
return isSeparateWidget(first, second) && root === getTreeRoot(second) && isPrecedingWidget(root, first, second);
|
|
526
526
|
};
|
|
527
527
|
|
|
528
|
-
const camelCase = (name: string): string =>
|
|
529
|
-
name.replaceAll(/-([a-z])/g, (_match, letter: string) => letter.toUpperCase());
|
|
530
|
-
|
|
531
528
|
const isAsymmetricMatcher = (value: unknown): boolean =>
|
|
532
529
|
typeof value === "object" && value !== null && typeof Reflect.get(value, "asymmetricMatch") === "function";
|
|
533
530
|
|
|
@@ -588,26 +585,8 @@ function readErrorMessageText(widget: Gtk.Widget): string | null {
|
|
|
588
585
|
return texts.length > 0 ? texts.join(" ") : null;
|
|
589
586
|
}
|
|
590
587
|
|
|
591
|
-
function assertReadableProperty(object: GObject.Object, name: string, property: string, value: unknown): void {
|
|
592
|
-
if (typeof value === "function") {
|
|
593
|
-
throw new TypeError(
|
|
594
|
-
`toHaveObjectProperty: "${name}" is shadowed by a method of the same name; ` +
|
|
595
|
-
`call ${property}() and assert on its result instead`,
|
|
596
|
-
);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
if (value === undefined && !Reflect.has(object, property)) {
|
|
600
|
-
throw new TypeError(
|
|
601
|
-
`toHaveObjectProperty: no readable property "${name}" on ${describeObject(object)}; ` +
|
|
602
|
-
"construct-only and write-only properties cannot be read back",
|
|
603
|
-
);
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
588
|
function readObjectProperty(object: GObject.Object, name: string): unknown {
|
|
608
|
-
const
|
|
609
|
-
const value: unknown = Reflect.get(object, property);
|
|
610
|
-
assertReadableProperty(object, name, property, value);
|
|
589
|
+
const value: unknown = Reflect.apply(GObject.getProperty, undefined, [object, name]);
|
|
611
590
|
|
|
612
591
|
return value;
|
|
613
592
|
}
|
|
@@ -804,14 +783,14 @@ function toBePartiallyPressed(received: unknown): MatcherResult {
|
|
|
804
783
|
return stateResult(widget, "partially pressed", state === MIXED_TRISTATE);
|
|
805
784
|
}
|
|
806
785
|
|
|
807
|
-
function toAppearBefore(received: unknown, other: Gtk.
|
|
786
|
+
function toAppearBefore(received: unknown, other: Gtk.Accessible): MatcherResult {
|
|
808
787
|
const widget = asWidget(received, "toAppearBefore");
|
|
809
788
|
const target = asWidget(other, "toAppearBefore");
|
|
810
789
|
|
|
811
790
|
return orderResult(widget, target, "before", isAppearingBefore(widget, target));
|
|
812
791
|
}
|
|
813
792
|
|
|
814
|
-
function toAppearAfter(received: unknown, other: Gtk.
|
|
793
|
+
function toAppearAfter(received: unknown, other: Gtk.Accessible): MatcherResult {
|
|
815
794
|
const widget = asWidget(received, "toAppearAfter");
|
|
816
795
|
const target = asWidget(other, "toAppearAfter");
|
|
817
796
|
|
|
@@ -943,15 +922,16 @@ function toHaveRole(received: unknown, expected: Gtk.AccessibleRole): MatcherRes
|
|
|
943
922
|
};
|
|
944
923
|
}
|
|
945
924
|
|
|
946
|
-
function toContainElement(received: unknown, descendant: Gtk.
|
|
925
|
+
function toContainElement(received: unknown, descendant: Gtk.Accessible | null): MatcherResult {
|
|
947
926
|
const widget = asWidget(received, "toContainElement");
|
|
948
|
-
const
|
|
927
|
+
const target = descendant === null ? null : asWidget(descendant, "toContainElement");
|
|
928
|
+
const isPass = target !== null && (target === widget || target.isAncestor(widget));
|
|
949
929
|
|
|
950
930
|
return {
|
|
951
931
|
pass: isPass,
|
|
952
932
|
message: () =>
|
|
953
933
|
`expected widget ${negationPrefix(isPass)}to contain ` +
|
|
954
|
-
`${
|
|
934
|
+
`${target === null ? "null" : describeWidget(target)}\n${describeWidget(widget)}`,
|
|
955
935
|
};
|
|
956
936
|
}
|
|
957
937
|
|
|
@@ -1020,64 +1000,62 @@ const registerMatchers = (): void => {
|
|
|
1020
1000
|
registration.isRegistered = true;
|
|
1021
1001
|
};
|
|
1022
1002
|
|
|
1023
|
-
declare module "
|
|
1024
|
-
/* eslint-disable @typescript-eslint/consistent-type-definitions --
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1003
|
+
declare module "vitest" {
|
|
1004
|
+
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars --
|
|
1005
|
+
declaration merging requires an interface with vitest's exact type parameters */
|
|
1006
|
+
interface Matchers<R extends void | Promise<void> = void | Promise<void>, T = unknown> {
|
|
1007
|
+
toHaveDisplayValue(expected?: TextExpectation): R;
|
|
1008
|
+
toHaveTextContent(expected?: TextExpectation, options?: TextContentOptions): R;
|
|
1009
|
+
toHaveAccessibleName(expected?: TextExpectation): R;
|
|
1010
|
+
toHaveAccessibleDescription(expected?: TextExpectation): R;
|
|
1011
|
+
toHaveAccessibleErrorMessage(expected?: TextExpectation): R;
|
|
1012
|
+
toHaveSelection(expected?: TextExpectation): R;
|
|
1032
1013
|
/* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */
|
|
1033
|
-
toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean):
|
|
1034
|
-
toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate):
|
|
1035
|
-
toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState):
|
|
1036
|
-
toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string):
|
|
1014
|
+
toHaveAccessibleState(state: BooleanAccessibleState, expected?: boolean): R;
|
|
1015
|
+
toHaveAccessibleState(state: TristateAccessibleState, expected?: Gtk.AccessibleTristate): R;
|
|
1016
|
+
toHaveAccessibleState(state: Gtk.AccessibleState.INVALID, expected?: Gtk.AccessibleInvalidState): R;
|
|
1017
|
+
toHaveAccessibleProperty(property: StringAccessibleProperty, expected?: string): R;
|
|
1037
1018
|
/* eslint-disable-next-line unicorn/consistent-boolean-name -- expected is the jest-dom matcher argument name */
|
|
1038
|
-
toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean):
|
|
1039
|
-
toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number):
|
|
1019
|
+
toHaveAccessibleProperty(property: BooleanAccessibleProperty, expected?: boolean): R;
|
|
1020
|
+
toHaveAccessibleProperty(property: NumberAccessibleProperty, expected?: number): R;
|
|
1040
1021
|
toHaveAccessibleProperty(
|
|
1041
1022
|
property: Gtk.AccessibleProperty.AUTOCOMPLETE,
|
|
1042
1023
|
expected?: Gtk.AccessibleAutocomplete,
|
|
1043
|
-
):
|
|
1044
|
-
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation):
|
|
1045
|
-
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort):
|
|
1046
|
-
toBeChecked():
|
|
1047
|
-
toBePartiallyChecked():
|
|
1048
|
-
toBePressed():
|
|
1049
|
-
toBePartiallyPressed():
|
|
1050
|
-
toBeDisabled():
|
|
1051
|
-
toBeEnabled():
|
|
1052
|
-
toBeVisible():
|
|
1053
|
-
toBeRooted():
|
|
1054
|
-
toBeEmptyWidget():
|
|
1055
|
-
toBeInvalid():
|
|
1056
|
-
toBeValid():
|
|
1057
|
-
toBeRequired():
|
|
1058
|
-
toHaveFocus():
|
|
1059
|
-
toHaveValue(expected?: number | string):
|
|
1060
|
-
toHaveRole(expected: Gtk.AccessibleRole):
|
|
1061
|
-
toContainElement(descendant: Gtk.
|
|
1062
|
-
toAppearBefore(other: Gtk.
|
|
1063
|
-
toAppearAfter(other: Gtk.
|
|
1064
|
-
toContainAnyByRole(...args: RoleQueryArgs):
|
|
1065
|
-
toContainOneByRole(...args: RoleQueryArgs):
|
|
1066
|
-
toContainAnyByText(...args: TextQueryArgs):
|
|
1067
|
-
toContainOneByText(...args: TextQueryArgs):
|
|
1068
|
-
toContainAnyByLabelText(...args: TextQueryArgs):
|
|
1069
|
-
toContainOneByLabelText(...args: TextQueryArgs):
|
|
1070
|
-
toContainAnyByPlaceholderText(...args: TextQueryArgs):
|
|
1071
|
-
toContainOneByPlaceholderText(...args: TextQueryArgs):
|
|
1072
|
-
toContainAnyByDisplayValue(...args: TextQueryArgs):
|
|
1073
|
-
toContainOneByDisplayValue(...args: TextQueryArgs):
|
|
1074
|
-
toHaveClass(...args: (ClassExpectation | { exact: boolean })[]):
|
|
1075
|
-
toHaveObjectProperty(name: string, expected?: unknown):
|
|
1024
|
+
): R;
|
|
1025
|
+
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.ORIENTATION, expected?: Gtk.Orientation): R;
|
|
1026
|
+
toHaveAccessibleProperty(property: Gtk.AccessibleProperty.SORT, expected?: Gtk.AccessibleSort): R;
|
|
1027
|
+
toBeChecked(): R;
|
|
1028
|
+
toBePartiallyChecked(): R;
|
|
1029
|
+
toBePressed(): R;
|
|
1030
|
+
toBePartiallyPressed(): R;
|
|
1031
|
+
toBeDisabled(): R;
|
|
1032
|
+
toBeEnabled(): R;
|
|
1033
|
+
toBeVisible(): R;
|
|
1034
|
+
toBeRooted(): R;
|
|
1035
|
+
toBeEmptyWidget(): R;
|
|
1036
|
+
toBeInvalid(): R;
|
|
1037
|
+
toBeValid(): R;
|
|
1038
|
+
toBeRequired(): R;
|
|
1039
|
+
toHaveFocus(): R;
|
|
1040
|
+
toHaveValue(expected?: number | string): R;
|
|
1041
|
+
toHaveRole(expected: Gtk.AccessibleRole): R;
|
|
1042
|
+
toContainElement(descendant: Gtk.Accessible | null): R;
|
|
1043
|
+
toAppearBefore(other: Gtk.Accessible): R;
|
|
1044
|
+
toAppearAfter(other: Gtk.Accessible): R;
|
|
1045
|
+
toContainAnyByRole(...args: RoleQueryArgs): R;
|
|
1046
|
+
toContainOneByRole(...args: RoleQueryArgs): R;
|
|
1047
|
+
toContainAnyByText(...args: TextQueryArgs): R;
|
|
1048
|
+
toContainOneByText(...args: TextQueryArgs): R;
|
|
1049
|
+
toContainAnyByLabelText(...args: TextQueryArgs): R;
|
|
1050
|
+
toContainOneByLabelText(...args: TextQueryArgs): R;
|
|
1051
|
+
toContainAnyByPlaceholderText(...args: TextQueryArgs): R;
|
|
1052
|
+
toContainOneByPlaceholderText(...args: TextQueryArgs): R;
|
|
1053
|
+
toContainAnyByDisplayValue(...args: TextQueryArgs): R;
|
|
1054
|
+
toContainOneByDisplayValue(...args: TextQueryArgs): R;
|
|
1055
|
+
toHaveClass(...args: (ClassExpectation | { exact: boolean })[]): R;
|
|
1056
|
+
toHaveObjectProperty(name: string, expected?: unknown): R;
|
|
1076
1057
|
}
|
|
1077
|
-
|
|
1078
|
-
interface Assertion extends WidgetMatchers {}
|
|
1079
|
-
interface AsymmetricMatchersContaining extends WidgetMatchers {}
|
|
1080
|
-
/* eslint-enable @typescript-eslint/consistent-type-definitions */
|
|
1058
|
+
/* eslint-enable @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-unused-vars */
|
|
1081
1059
|
}
|
|
1082
1060
|
|
|
1083
1061
|
export { matchers, registerMatchers, type ClassExpectation, type TextContentOptions, type TextExpectation };
|