@react-aria/test-utils 1.0.0-beta.2 → 1.0.0-beta.3
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/dist/import.mjs +5 -5
- package/dist/main.js +9 -9
- package/dist/module.js +5 -5
- package/dist/{checkboxgroup.main.js → private/checkboxgroup.cjs} +19 -19
- package/dist/private/checkboxgroup.cjs.map +1 -0
- package/dist/{checkboxgroup.mjs → private/checkboxgroup.js} +19 -19
- package/dist/private/checkboxgroup.js.map +1 -0
- package/dist/{combobox.main.js → private/combobox.cjs} +35 -35
- package/dist/private/combobox.cjs.map +1 -0
- package/dist/{combobox.mjs → private/combobox.js} +35 -35
- package/dist/private/combobox.js.map +1 -0
- package/dist/{dialog.main.js → private/dialog.cjs} +19 -19
- package/dist/private/dialog.cjs.map +1 -0
- package/dist/{dialog.mjs → private/dialog.js} +19 -19
- package/dist/private/dialog.js.map +1 -0
- package/dist/{events.main.js → private/events.cjs} +32 -34
- package/dist/private/events.cjs.map +1 -0
- package/dist/{events.mjs → private/events.js} +29 -31
- package/dist/private/events.js.map +1 -0
- package/dist/{gridlist.main.js → private/gridlist.cjs} +27 -28
- package/dist/private/gridlist.cjs.map +1 -0
- package/dist/{gridlist.mjs → private/gridlist.js} +27 -28
- package/dist/private/gridlist.js.map +1 -0
- package/dist/{listbox.main.js → private/listbox.cjs} +24 -24
- package/dist/private/listbox.cjs.map +1 -0
- package/dist/{listbox.mjs → private/listbox.js} +24 -24
- package/dist/private/listbox.js.map +1 -0
- package/dist/{menu.main.js → private/menu.cjs} +46 -48
- package/dist/private/menu.cjs.map +1 -0
- package/dist/{menu.mjs → private/menu.js} +46 -48
- package/dist/private/menu.js.map +1 -0
- package/dist/{radiogroup.main.js → private/radiogroup.cjs} +21 -24
- package/dist/private/radiogroup.cjs.map +1 -0
- package/dist/{radiogroup.mjs → private/radiogroup.js} +21 -24
- package/dist/private/radiogroup.js.map +1 -0
- package/dist/{select.main.js → private/select.cjs} +31 -29
- package/dist/private/select.cjs.map +1 -0
- package/dist/{select.module.js → private/select.js} +31 -29
- package/dist/private/select.js.map +1 -0
- package/dist/{table.main.js → private/table.cjs} +82 -57
- package/dist/private/table.cjs.map +1 -0
- package/dist/{table.module.js → private/table.js} +82 -57
- package/dist/private/table.js.map +1 -0
- package/dist/{tabs.main.js → private/tabs.cjs} +21 -25
- package/dist/private/tabs.cjs.map +1 -0
- package/dist/{tabs.mjs → private/tabs.js} +21 -25
- package/dist/private/tabs.js.map +1 -0
- package/dist/{testSetup.main.js → private/testSetup.cjs} +27 -19
- package/dist/private/testSetup.cjs.map +1 -0
- package/dist/{testSetup.module.js → private/testSetup.js} +26 -18
- package/dist/private/testSetup.js.map +1 -0
- package/dist/{tree.main.js → private/tree.cjs} +34 -35
- package/dist/private/tree.cjs.map +1 -0
- package/dist/{tree.mjs → private/tree.js} +34 -35
- package/dist/private/tree.js.map +1 -0
- package/dist/private/user.cjs +85 -0
- package/dist/private/user.cjs.map +1 -0
- package/dist/private/user.js +76 -0
- package/dist/private/user.js.map +1 -0
- package/dist/{userEventMaps.main.js → private/userEventMaps.cjs} +3 -3
- package/dist/{userEventMaps.main.js.map → private/userEventMaps.cjs.map} +1 -1
- package/dist/{userEventMaps.mjs → private/userEventMaps.js} +3 -3
- package/dist/{userEventMaps.module.js.map → private/userEventMaps.js.map} +1 -1
- package/dist/types/src/checkboxgroup.d.ts +45 -0
- package/dist/types/src/combobox.d.ts +75 -0
- package/dist/types/src/dialog.d.ts +36 -0
- package/dist/types/src/events.d.ts +25 -0
- package/dist/types/src/gridlist.d.ts +51 -0
- package/dist/types/src/index.d.ts +16 -0
- package/dist/types/src/listbox.d.ts +80 -0
- package/dist/types/src/menu.d.ts +102 -0
- package/dist/types/src/radiogroup.d.ts +46 -0
- package/dist/types/src/select.d.ts +67 -0
- package/dist/types/src/table.d.ts +104 -0
- package/dist/types/src/tabs.d.ts +58 -0
- package/dist/types/src/testSetup.d.ts +6 -0
- package/dist/types/src/tree.d.ts +57 -0
- package/dist/types/src/types.d.ts +136 -0
- package/dist/types/src/user.d.ts +47 -0
- package/dist/types/src/userEventMaps.d.ts +2 -0
- package/package.json +7 -7
- package/src/select.ts +10 -2
- package/src/table.ts +46 -1
- package/dist/checkboxgroup.main.js.map +0 -1
- package/dist/checkboxgroup.module.js +0 -99
- package/dist/checkboxgroup.module.js.map +0 -1
- package/dist/combobox.main.js.map +0 -1
- package/dist/combobox.module.js +0 -167
- package/dist/combobox.module.js.map +0 -1
- package/dist/dialog.main.js.map +0 -1
- package/dist/dialog.module.js +0 -100
- package/dist/dialog.module.js.map +0 -1
- package/dist/events.main.js.map +0 -1
- package/dist/events.module.js +0 -112
- package/dist/events.module.js.map +0 -1
- package/dist/gridlist.main.js.map +0 -1
- package/dist/gridlist.module.js +0 -149
- package/dist/gridlist.module.js.map +0 -1
- package/dist/listbox.main.js.map +0 -1
- package/dist/listbox.module.js +0 -138
- package/dist/listbox.module.js.map +0 -1
- package/dist/menu.main.js.map +0 -1
- package/dist/menu.module.js +0 -269
- package/dist/menu.module.js.map +0 -1
- package/dist/radiogroup.main.js.map +0 -1
- package/dist/radiogroup.module.js +0 -118
- package/dist/radiogroup.module.js.map +0 -1
- package/dist/select.main.js.map +0 -1
- package/dist/select.mjs +0 -158
- package/dist/select.module.js.map +0 -1
- package/dist/table.main.js.map +0 -1
- package/dist/table.mjs +0 -290
- package/dist/table.module.js.map +0 -1
- package/dist/tabs.main.js.map +0 -1
- package/dist/tabs.module.js +0 -130
- package/dist/tabs.module.js.map +0 -1
- package/dist/testSetup.main.js.map +0 -1
- package/dist/testSetup.mjs +0 -73
- package/dist/testSetup.module.js.map +0 -1
- package/dist/tree.main.js.map +0 -1
- package/dist/tree.module.js +0 -179
- package/dist/tree.module.js.map +0 -1
- package/dist/types.d.ts +0 -823
- package/dist/types.d.ts.map +0 -1
- package/dist/user.main.js +0 -85
- package/dist/user.main.js.map +0 -1
- package/dist/user.mjs +0 -76
- package/dist/user.module.js +0 -76
- package/dist/user.module.js.map +0 -1
- package/dist/userEventMaps.module.js +0 -38
package/dist/types.d.ts
DELETED
|
@@ -1,823 +0,0 @@
|
|
|
1
|
-
import { pointerKey } from "@testing-library/user-event";
|
|
2
|
-
type Direction = 'ltr' | 'rtl';
|
|
3
|
-
export interface UserOpts {
|
|
4
|
-
/**
|
|
5
|
-
* The interaction type (mouse, touch, keyboard) that the test util user will use when interacting with a component. This can be overridden
|
|
6
|
-
* at the aria pattern tester level if needed.
|
|
7
|
-
* @default mouse
|
|
8
|
-
*/
|
|
9
|
-
interactionType?: 'mouse' | 'touch' | 'keyboard';
|
|
10
|
-
/**
|
|
11
|
-
* A function used by the test utils to advance timers during interactions. Required for certain aria patterns (e.g. table). This can be overridden
|
|
12
|
-
* at the aria pattern tester level if needed.
|
|
13
|
-
*/
|
|
14
|
-
advanceTimer?: (time: number) => unknown | Promise<unknown>;
|
|
15
|
-
}
|
|
16
|
-
interface BaseTesterOpts extends UserOpts {
|
|
17
|
-
/** @private */
|
|
18
|
-
user?: any;
|
|
19
|
-
/** The base element for the given tester (e.g. the table, menu trigger button, etc). */
|
|
20
|
-
root: HTMLElement;
|
|
21
|
-
}
|
|
22
|
-
interface CheckboxGroupTesterOpts extends BaseTesterOpts {
|
|
23
|
-
}
|
|
24
|
-
interface ComboBoxTesterOpts extends BaseTesterOpts {
|
|
25
|
-
/**
|
|
26
|
-
* The base element for the combobox. If provided the wrapping element around the target combobox (as is the the case with a ref provided to RSP ComboBox),
|
|
27
|
-
* will automatically search for the combobox element within.
|
|
28
|
-
*/
|
|
29
|
-
root: HTMLElement;
|
|
30
|
-
/**
|
|
31
|
-
* The node of the combobox trigger button if any. If not provided, we will try to automatically use any button
|
|
32
|
-
* within the `root` provided or that the `root` serves as the trigger.
|
|
33
|
-
*/
|
|
34
|
-
trigger?: HTMLElement;
|
|
35
|
-
}
|
|
36
|
-
interface DialogTesterOpts extends BaseTesterOpts {
|
|
37
|
-
/**
|
|
38
|
-
* The trigger element for the dialog.
|
|
39
|
-
*/
|
|
40
|
-
root: HTMLElement;
|
|
41
|
-
/**
|
|
42
|
-
* The overlay type of the dialog. Used to inform the tester how to find the dialog.
|
|
43
|
-
*/
|
|
44
|
-
overlayType?: 'modal' | 'popover';
|
|
45
|
-
}
|
|
46
|
-
interface GridListTesterOpts extends BaseTesterOpts {
|
|
47
|
-
}
|
|
48
|
-
interface ListBoxTesterOpts extends BaseTesterOpts {
|
|
49
|
-
/**
|
|
50
|
-
* A function used by the test utils to advance timers during interactions.
|
|
51
|
-
*/
|
|
52
|
-
advanceTimer?: UserOpts['advanceTimer'];
|
|
53
|
-
}
|
|
54
|
-
interface MenuTesterOpts extends BaseTesterOpts {
|
|
55
|
-
/**
|
|
56
|
-
* The trigger element for the menu.
|
|
57
|
-
*/
|
|
58
|
-
root: HTMLElement;
|
|
59
|
-
/**
|
|
60
|
-
* Whether the current menu is a submenu.
|
|
61
|
-
*/
|
|
62
|
-
isSubmenu?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* The root menu of the menu tree. Only available if the menu is a submenu.
|
|
65
|
-
*/
|
|
66
|
-
rootMenu?: HTMLElement;
|
|
67
|
-
}
|
|
68
|
-
interface RadioGroupTesterOpts extends BaseTesterOpts {
|
|
69
|
-
/**
|
|
70
|
-
* The horizontal layout direction, typically affected by locale.
|
|
71
|
-
* @default 'ltr'
|
|
72
|
-
*/
|
|
73
|
-
direction?: Direction;
|
|
74
|
-
}
|
|
75
|
-
interface SelectTesterOpts extends BaseTesterOpts {
|
|
76
|
-
/**
|
|
77
|
-
* The trigger element for the select. If provided the wrapping element around the target select (as is the case with a ref provided to RSP Select),
|
|
78
|
-
* will automatically search for the select's trigger element within.
|
|
79
|
-
*/
|
|
80
|
-
root: HTMLElement;
|
|
81
|
-
}
|
|
82
|
-
interface TableTesterOpts extends BaseTesterOpts {
|
|
83
|
-
/**
|
|
84
|
-
* A function used by the test utils to advance timers during interactions.
|
|
85
|
-
*/
|
|
86
|
-
advanceTimer?: UserOpts['advanceTimer'];
|
|
87
|
-
}
|
|
88
|
-
interface TabsTesterOpts extends BaseTesterOpts {
|
|
89
|
-
/**
|
|
90
|
-
* The horizontal layout direction, typically affected by locale.
|
|
91
|
-
* @default 'ltr'
|
|
92
|
-
*/
|
|
93
|
-
direction?: Direction;
|
|
94
|
-
}
|
|
95
|
-
interface TreeTesterOpts extends BaseTesterOpts {
|
|
96
|
-
/**
|
|
97
|
-
* A function used by the test utils to advance timers during interactions.
|
|
98
|
-
*/
|
|
99
|
-
advanceTimer?: UserOpts['advanceTimer'];
|
|
100
|
-
}
|
|
101
|
-
interface BaseGridRowInteractionOpts {
|
|
102
|
-
/**
|
|
103
|
-
* The index, text, or node of the row to target.
|
|
104
|
-
*/
|
|
105
|
-
row: number | string | HTMLElement;
|
|
106
|
-
/**
|
|
107
|
-
* What interaction type to use when interacting with the row. Defaults to the interaction type set on the tester.
|
|
108
|
-
*/
|
|
109
|
-
interactionType?: UserOpts['interactionType'];
|
|
110
|
-
}
|
|
111
|
-
interface ToggleGridRowOpts extends BaseGridRowInteractionOpts {
|
|
112
|
-
/**
|
|
113
|
-
* Whether the row needs to be long pressed to be selected. Depends on the components implementation.
|
|
114
|
-
*/
|
|
115
|
-
needsLongPress?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* Whether the checkbox should be used to select the row. If false, will attempt to select the row via press.
|
|
118
|
-
* @default 'true'
|
|
119
|
-
*/
|
|
120
|
-
checkboxSelection?: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Whether the grid has a selectionBehavior of "toggle" or "replace" (aka highlight selection). This affects the user operations
|
|
123
|
-
* required to toggle row selection by adding modifier keys during user actions, useful when performing multi-row selection in a "selectionBehavior: 'replace'" grid.
|
|
124
|
-
* If you would like to still simulate user actions (aka press) without these modifiers keys for a "selectionBehavior: replace" grid, simply omit this option.
|
|
125
|
-
* See the "Selection Behavior" section of the appropriate React Aria Component docs for more information (e.g. https://react-spectrum.adobe.com/react-aria/Tree.html#selection-behavior).
|
|
126
|
-
*
|
|
127
|
-
* @default 'toggle'
|
|
128
|
-
*/
|
|
129
|
-
selectionBehavior?: 'toggle' | 'replace';
|
|
130
|
-
}
|
|
131
|
-
interface GridRowActionOpts extends BaseGridRowInteractionOpts {
|
|
132
|
-
/**
|
|
133
|
-
* Whether or not the row needs a double click to trigger the row action. Depends on the components implementation.
|
|
134
|
-
*/
|
|
135
|
-
needsDoubleClick?: boolean;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Simulates a "long press" event on a element.
|
|
139
|
-
* @param opts - Options for the long press.
|
|
140
|
-
* @param opts.element - Element to long press.
|
|
141
|
-
* @param opts.advanceTimer - Function that when called advances the timers in your test suite by a specific amount of time(ms).
|
|
142
|
-
* @param opts.pointeropts - Options to pass to the simulated event. Defaults to mouse. See https://testing-library.com/docs/dom-testing-library/api-events/#fireevent for more info.
|
|
143
|
-
*/
|
|
144
|
-
export function triggerLongPress(opts: {
|
|
145
|
-
element: HTMLElement;
|
|
146
|
-
advanceTimer: (time: number) => unknown | Promise<unknown>;
|
|
147
|
-
pointerOpts?: Record<string, any>;
|
|
148
|
-
}): Promise<void>;
|
|
149
|
-
/**
|
|
150
|
-
* Enables reading pageX/pageY from fireEvent.mouse*(..., {pageX: ..., pageY: ...}).
|
|
151
|
-
*/
|
|
152
|
-
export function installMouseEvent(): void;
|
|
153
|
-
export function installPointerEvent(): void;
|
|
154
|
-
export let pointerMap: pointerKey[];
|
|
155
|
-
interface TriggerCheckboxOptions {
|
|
156
|
-
/**
|
|
157
|
-
* What interaction type to use when triggering a checkbox. Defaults to the interaction type set on the tester.
|
|
158
|
-
*/
|
|
159
|
-
interactionType?: UserOpts['interactionType'];
|
|
160
|
-
/**
|
|
161
|
-
* The index, text, or node of the checkbox to toggle selection for.
|
|
162
|
-
*/
|
|
163
|
-
checkbox: number | string | HTMLElement;
|
|
164
|
-
}
|
|
165
|
-
export class CheckboxGroupTester {
|
|
166
|
-
constructor(opts: CheckboxGroupTesterOpts);
|
|
167
|
-
/**
|
|
168
|
-
* Set the interaction type used by the checkbox group tester.
|
|
169
|
-
*/
|
|
170
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
171
|
-
/**
|
|
172
|
-
* Returns a checkbox matching the specified index or text content.
|
|
173
|
-
*/
|
|
174
|
-
findCheckbox(opts: {
|
|
175
|
-
checkboxIndexOrText: number | string;
|
|
176
|
-
}): HTMLElement;
|
|
177
|
-
/**
|
|
178
|
-
* Toggles the specified checkbox. Defaults to using the interaction type set on the checkbox tester.
|
|
179
|
-
*/
|
|
180
|
-
toggleCheckbox(opts: TriggerCheckboxOptions): Promise<void>;
|
|
181
|
-
/**
|
|
182
|
-
* Returns the checkboxgroup.
|
|
183
|
-
*/
|
|
184
|
-
get checkboxgroup(): HTMLElement;
|
|
185
|
-
/**
|
|
186
|
-
* Returns the checkboxes.
|
|
187
|
-
*/
|
|
188
|
-
get checkboxes(): HTMLElement[];
|
|
189
|
-
/**
|
|
190
|
-
* Returns the currently selected checkboxes in the checkboxgroup if any.
|
|
191
|
-
*/
|
|
192
|
-
get selectedCheckboxes(): HTMLElement[];
|
|
193
|
-
}
|
|
194
|
-
interface ComboBoxOpenOpts {
|
|
195
|
-
/**
|
|
196
|
-
* Whether the combobox opens on focus or needs to be manually opened via user action.
|
|
197
|
-
* @default 'manual'
|
|
198
|
-
*/
|
|
199
|
-
triggerBehavior?: 'focus' | 'manual';
|
|
200
|
-
/**
|
|
201
|
-
* What interaction type to use when opening the combobox. Defaults to the interaction type set on the tester.
|
|
202
|
-
*/
|
|
203
|
-
interactionType?: UserOpts['interactionType'];
|
|
204
|
-
}
|
|
205
|
-
interface ComboBoxSelectOpts extends ComboBoxOpenOpts {
|
|
206
|
-
/**
|
|
207
|
-
* The index, text, or node of the option to select. Option nodes can be sourced via `options()`.
|
|
208
|
-
*/
|
|
209
|
-
option: number | string | HTMLElement;
|
|
210
|
-
}
|
|
211
|
-
export class ComboBoxTester {
|
|
212
|
-
constructor(opts: ComboBoxTesterOpts);
|
|
213
|
-
/**
|
|
214
|
-
* Set the interaction type used by the combobox tester.
|
|
215
|
-
*/
|
|
216
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
217
|
-
/**
|
|
218
|
-
* Opens the combobox dropdown. Defaults to using the interaction type set on the combobox tester.
|
|
219
|
-
*/
|
|
220
|
-
open(opts?: ComboBoxOpenOpts): Promise<void>;
|
|
221
|
-
/**
|
|
222
|
-
* Returns an option matching the specified index or text content.
|
|
223
|
-
*/
|
|
224
|
-
findOption(opts: {
|
|
225
|
-
optionIndexOrText: number | string;
|
|
226
|
-
}): HTMLElement;
|
|
227
|
-
/**
|
|
228
|
-
* Selects the desired combobox option. Defaults to using the interaction type set on the combobox tester. If necessary, will open the combobox dropdown beforehand.
|
|
229
|
-
* The desired option can be targeted via the option's node, the option's text, or the option's index.
|
|
230
|
-
*/
|
|
231
|
-
selectOption(opts: ComboBoxSelectOpts): Promise<void>;
|
|
232
|
-
/**
|
|
233
|
-
* Closes the combobox dropdown.
|
|
234
|
-
*/
|
|
235
|
-
close(): Promise<void>;
|
|
236
|
-
/**
|
|
237
|
-
* Returns the combobox.
|
|
238
|
-
*/
|
|
239
|
-
get combobox(): HTMLElement;
|
|
240
|
-
/**
|
|
241
|
-
* Returns the combobox trigger button.
|
|
242
|
-
*/
|
|
243
|
-
get trigger(): HTMLElement;
|
|
244
|
-
/**
|
|
245
|
-
* Returns the combobox's listbox if present.
|
|
246
|
-
*/
|
|
247
|
-
get listbox(): HTMLElement | null;
|
|
248
|
-
/**
|
|
249
|
-
* Returns the combobox's sections if present.
|
|
250
|
-
*/
|
|
251
|
-
get sections(): HTMLElement[];
|
|
252
|
-
/**
|
|
253
|
-
* Returns the combobox's options if present. Can be filtered to a subsection of the listbox if provided via `element`.
|
|
254
|
-
*/
|
|
255
|
-
options(opts?: {
|
|
256
|
-
element?: HTMLElement;
|
|
257
|
-
}): HTMLElement[];
|
|
258
|
-
/**
|
|
259
|
-
* Returns the currently focused option in the combobox's dropdown if any.
|
|
260
|
-
*/
|
|
261
|
-
get focusedOption(): HTMLElement | null;
|
|
262
|
-
}
|
|
263
|
-
interface DialogOpenOpts {
|
|
264
|
-
/**
|
|
265
|
-
* What interaction type to use when opening the dialog. Defaults to the interaction type set on the tester.
|
|
266
|
-
*/
|
|
267
|
-
interactionType?: UserOpts['interactionType'];
|
|
268
|
-
}
|
|
269
|
-
export class DialogTester {
|
|
270
|
-
constructor(opts: DialogTesterOpts);
|
|
271
|
-
/**
|
|
272
|
-
* Set the interaction type used by the dialog tester.
|
|
273
|
-
*/
|
|
274
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
275
|
-
/**
|
|
276
|
-
* Opens the dialog. Defaults to using the interaction type set on the dialog tester.
|
|
277
|
-
*/
|
|
278
|
-
open(opts?: DialogOpenOpts): Promise<void>;
|
|
279
|
-
/**
|
|
280
|
-
* Closes the dialog via the Escape key.
|
|
281
|
-
*/
|
|
282
|
-
close(): Promise<void>;
|
|
283
|
-
/**
|
|
284
|
-
* Returns the dialog's trigger.
|
|
285
|
-
*/
|
|
286
|
-
get trigger(): HTMLElement;
|
|
287
|
-
/**
|
|
288
|
-
* Returns the dialog if present.
|
|
289
|
-
*/
|
|
290
|
-
get dialog(): HTMLElement | null;
|
|
291
|
-
}
|
|
292
|
-
interface GridListToggleRowOpts extends ToggleGridRowOpts {
|
|
293
|
-
}
|
|
294
|
-
interface GridListRowActionOpts extends GridRowActionOpts {
|
|
295
|
-
}
|
|
296
|
-
export class GridListTester {
|
|
297
|
-
constructor(opts: GridListTesterOpts);
|
|
298
|
-
/**
|
|
299
|
-
* Set the interaction type used by the gridlist tester.
|
|
300
|
-
*/
|
|
301
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
302
|
-
/**
|
|
303
|
-
* Returns a row matching the specified index or text content.
|
|
304
|
-
*/
|
|
305
|
-
findRow(opts: {
|
|
306
|
-
rowIndexOrText: number | string;
|
|
307
|
-
}): HTMLElement;
|
|
308
|
-
/**
|
|
309
|
-
* Toggles the selection for the specified gridlist row. Defaults to using the interaction type set on the gridlist tester.
|
|
310
|
-
* Note that this will endevor to always add/remove JUST the provided row to the set of selected rows.
|
|
311
|
-
*/
|
|
312
|
-
toggleRowSelection(opts: GridListToggleRowOpts): Promise<void>;
|
|
313
|
-
/**
|
|
314
|
-
* Triggers the action for the specified gridlist row. Defaults to using the interaction type set on the gridlist tester.
|
|
315
|
-
*/
|
|
316
|
-
triggerRowAction(opts: GridListRowActionOpts): Promise<void>;
|
|
317
|
-
/**
|
|
318
|
-
* Returns the gridlist.
|
|
319
|
-
*/
|
|
320
|
-
get gridlist(): HTMLElement;
|
|
321
|
-
/**
|
|
322
|
-
* Returns the gridlist's rows if any.
|
|
323
|
-
*/
|
|
324
|
-
get rows(): HTMLElement[];
|
|
325
|
-
/**
|
|
326
|
-
* Returns the gridlist's selected rows if any.
|
|
327
|
-
*/
|
|
328
|
-
get selectedRows(): HTMLElement[];
|
|
329
|
-
/**
|
|
330
|
-
* Returns the gridlist's cells if any. Can be filtered against a specific row if provided via `element`.
|
|
331
|
-
*/
|
|
332
|
-
cells(opts?: {
|
|
333
|
-
element?: HTMLElement;
|
|
334
|
-
}): HTMLElement[];
|
|
335
|
-
}
|
|
336
|
-
interface ListBoxToggleOptionOpts {
|
|
337
|
-
/**
|
|
338
|
-
* What interaction type to use when toggling selection for an option. Defaults to the interaction type set on the tester.
|
|
339
|
-
*/
|
|
340
|
-
interactionType?: UserOpts['interactionType'];
|
|
341
|
-
/**
|
|
342
|
-
* The index, text, or node of the option to toggle selection for.
|
|
343
|
-
*/
|
|
344
|
-
option: number | string | HTMLElement;
|
|
345
|
-
/**
|
|
346
|
-
* Whether the option should be triggered by Space or Enter in keyboard modality.
|
|
347
|
-
* @default 'Enter'
|
|
348
|
-
*/
|
|
349
|
-
keyboardActivation?: 'Space' | 'Enter';
|
|
350
|
-
/**
|
|
351
|
-
* Whether the option needs to be long pressed to be selected. Depends on the listbox's implementation.
|
|
352
|
-
*/
|
|
353
|
-
needsLongPress?: boolean;
|
|
354
|
-
/**
|
|
355
|
-
* Whether the listbox has a selectionBehavior of "toggle" or "replace" (aka highlight selection). This affects the user operations
|
|
356
|
-
* required to toggle option selection by adding modifier keys during user actions, useful when performing multi-option selection in a "selectionBehavior: 'replace'" listbox.
|
|
357
|
-
* If you would like to still simulate user actions (aka press) without these modifiers keys for a "selectionBehavior: replace" listbox, simply omit this option.
|
|
358
|
-
* See the [RAC Listbox docs](https://react-spectrum.adobe.com/react-aria/ListBox.html#selection-behavior) for more info on this behavior.
|
|
359
|
-
*
|
|
360
|
-
* @default 'toggle'
|
|
361
|
-
*/
|
|
362
|
-
selectionBehavior?: 'toggle' | 'replace';
|
|
363
|
-
}
|
|
364
|
-
interface ListBoxOptionActionOpts extends Omit<ListBoxToggleOptionOpts, 'keyboardActivation' | 'needsLongPress'> {
|
|
365
|
-
/**
|
|
366
|
-
* Whether or not the option needs a double click to trigger the option action. Depends on the listbox's implementation.
|
|
367
|
-
*/
|
|
368
|
-
needsDoubleClick?: boolean;
|
|
369
|
-
}
|
|
370
|
-
export class ListBoxTester {
|
|
371
|
-
constructor(opts: ListBoxTesterOpts);
|
|
372
|
-
/**
|
|
373
|
-
* Set the interaction type used by the listbox tester.
|
|
374
|
-
*/
|
|
375
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
376
|
-
/**
|
|
377
|
-
* Returns a option matching the specified index or text content.
|
|
378
|
-
*/
|
|
379
|
-
findOption(opts: {
|
|
380
|
-
optionIndexOrText: number | string;
|
|
381
|
-
}): HTMLElement;
|
|
382
|
-
/**
|
|
383
|
-
* Toggles the selection for the specified listbox option. Defaults to using the interaction type set on the listbox tester.
|
|
384
|
-
*/
|
|
385
|
-
toggleOptionSelection(opts: ListBoxToggleOptionOpts): Promise<void>;
|
|
386
|
-
/**
|
|
387
|
-
* Triggers the action for the specified listbox option. Defaults to using the interaction type set on the listbox tester.
|
|
388
|
-
*/
|
|
389
|
-
triggerOptionAction(opts: ListBoxOptionActionOpts): Promise<void>;
|
|
390
|
-
/**
|
|
391
|
-
* Returns the listbox.
|
|
392
|
-
*/
|
|
393
|
-
get listbox(): HTMLElement;
|
|
394
|
-
/**
|
|
395
|
-
* Returns the listbox options. Can be filtered to a subsection of the listbox if provided via `element`.
|
|
396
|
-
*/
|
|
397
|
-
options(opts?: {
|
|
398
|
-
element?: HTMLElement;
|
|
399
|
-
}): HTMLElement[];
|
|
400
|
-
/**
|
|
401
|
-
* Returns the listbox's selected options if any.
|
|
402
|
-
*/
|
|
403
|
-
get selectedOptions(): HTMLElement[];
|
|
404
|
-
/**
|
|
405
|
-
* Returns the listbox's sections if any.
|
|
406
|
-
*/
|
|
407
|
-
get sections(): HTMLElement[];
|
|
408
|
-
}
|
|
409
|
-
interface MenuOpenOpts {
|
|
410
|
-
/**
|
|
411
|
-
* Whether the menu needs to be long pressed to open.
|
|
412
|
-
*/
|
|
413
|
-
needsLongPress?: boolean;
|
|
414
|
-
/**
|
|
415
|
-
* What interaction type to use when opening the menu. Defaults to the interaction type set on the tester.
|
|
416
|
-
*/
|
|
417
|
-
interactionType?: UserOpts['interactionType'];
|
|
418
|
-
/**
|
|
419
|
-
* Whether to open the menu via ArrowUp or ArrowDown if in keyboard modality.
|
|
420
|
-
*/
|
|
421
|
-
direction?: 'up' | 'down';
|
|
422
|
-
}
|
|
423
|
-
interface MenuSelectOpts extends MenuOpenOpts {
|
|
424
|
-
/**
|
|
425
|
-
* The index, text, or node of the option to select. Option nodes can be sourced via `options()`.
|
|
426
|
-
*/
|
|
427
|
-
option: number | string | HTMLElement;
|
|
428
|
-
/**
|
|
429
|
-
* The menu's selection mode. Will affect whether or not the menu is expected to be closed upon option selection.
|
|
430
|
-
* @default 'single'
|
|
431
|
-
*/
|
|
432
|
-
menuSelectionMode?: 'single' | 'multiple';
|
|
433
|
-
/**
|
|
434
|
-
* Whether or not the menu closes on select. Depends on menu implementation and configuration.
|
|
435
|
-
* @default true
|
|
436
|
-
*/
|
|
437
|
-
closesOnSelect?: boolean;
|
|
438
|
-
/**
|
|
439
|
-
* Whether the option should be triggered by Space or Enter in keyboard modality.
|
|
440
|
-
* @default 'Enter'
|
|
441
|
-
*/
|
|
442
|
-
keyboardActivation?: 'Space' | 'Enter';
|
|
443
|
-
}
|
|
444
|
-
interface MenuOpenSubmenuOpts extends MenuOpenOpts {
|
|
445
|
-
/**
|
|
446
|
-
* The text or node of the submenu trigger to open. Available submenu trigger nodes can be sourced via `submenuTriggers`.
|
|
447
|
-
*/
|
|
448
|
-
submenuTrigger: string | HTMLElement;
|
|
449
|
-
}
|
|
450
|
-
export class MenuTester {
|
|
451
|
-
constructor(opts: MenuTesterOpts);
|
|
452
|
-
/**
|
|
453
|
-
* Set the interaction type used by the menu tester.
|
|
454
|
-
*/
|
|
455
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
456
|
-
/**
|
|
457
|
-
* Opens the menu. Defaults to using the interaction type set on the menu tester.
|
|
458
|
-
*/
|
|
459
|
-
open(opts?: MenuOpenOpts): Promise<void>;
|
|
460
|
-
/**
|
|
461
|
-
* Returns a option matching the specified index or text content.
|
|
462
|
-
*/
|
|
463
|
-
findOption(opts: {
|
|
464
|
-
optionIndexOrText: number | string;
|
|
465
|
-
}): HTMLElement;
|
|
466
|
-
/**
|
|
467
|
-
* Selects the desired menu option. Defaults to using the interaction type set on the menu tester. If necessary, will open the menu dropdown beforehand.
|
|
468
|
-
* The desired option can be targeted via the option's node, the option's text, or the option's index.
|
|
469
|
-
*/
|
|
470
|
-
selectOption(opts: MenuSelectOpts): Promise<void>;
|
|
471
|
-
/**
|
|
472
|
-
* Opens the submenu. Defaults to using the interaction type set on the menu tester. The submenu trigger can be targeted via the trigger's node or the trigger's text.
|
|
473
|
-
*/
|
|
474
|
-
openSubmenu(opts: MenuOpenSubmenuOpts): Promise<MenuTester | null>;
|
|
475
|
-
/**
|
|
476
|
-
* Closes the menu.
|
|
477
|
-
*/
|
|
478
|
-
close(): Promise<void>;
|
|
479
|
-
/**
|
|
480
|
-
* Returns the menu's trigger.
|
|
481
|
-
*/
|
|
482
|
-
get trigger(): HTMLElement;
|
|
483
|
-
/**
|
|
484
|
-
* Returns the menu if present.
|
|
485
|
-
*/
|
|
486
|
-
get menu(): HTMLElement | null;
|
|
487
|
-
/**
|
|
488
|
-
* Returns the menu's sections if any.
|
|
489
|
-
*/
|
|
490
|
-
get sections(): HTMLElement[];
|
|
491
|
-
/**
|
|
492
|
-
* Returns the menu's options if present. Can be filtered to a subsection of the menu if provided via `element`.
|
|
493
|
-
*/
|
|
494
|
-
options(opts?: {
|
|
495
|
-
element?: HTMLElement;
|
|
496
|
-
}): HTMLElement[];
|
|
497
|
-
/**
|
|
498
|
-
* Returns the menu's submenu triggers if any.
|
|
499
|
-
*/
|
|
500
|
-
get submenuTriggers(): HTMLElement[];
|
|
501
|
-
}
|
|
502
|
-
interface TriggerRadioOptions {
|
|
503
|
-
/**
|
|
504
|
-
* What interaction type to use when triggering a radio. Defaults to the interaction type set on the tester.
|
|
505
|
-
*/
|
|
506
|
-
interactionType?: UserOpts['interactionType'];
|
|
507
|
-
/**
|
|
508
|
-
* The index, text, or node of the radio to toggle selection for.
|
|
509
|
-
*/
|
|
510
|
-
radio: number | string | HTMLElement;
|
|
511
|
-
}
|
|
512
|
-
export class RadioGroupTester {
|
|
513
|
-
constructor(opts: RadioGroupTesterOpts);
|
|
514
|
-
/**
|
|
515
|
-
* Set the interaction type used by the radio tester.
|
|
516
|
-
*/
|
|
517
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
518
|
-
/**
|
|
519
|
-
* Returns a radio matching the specified index or text content.
|
|
520
|
-
*/
|
|
521
|
-
findRadio(opts: {
|
|
522
|
-
radioIndexOrText: number | string;
|
|
523
|
-
}): HTMLElement;
|
|
524
|
-
/**
|
|
525
|
-
* Triggers the specified radio. Defaults to using the interaction type set on the radio tester.
|
|
526
|
-
*/
|
|
527
|
-
triggerRadio(opts: TriggerRadioOptions): Promise<void>;
|
|
528
|
-
/**
|
|
529
|
-
* Returns the radiogroup.
|
|
530
|
-
*/
|
|
531
|
-
get radiogroup(): HTMLElement;
|
|
532
|
-
/**
|
|
533
|
-
* Returns the radios.
|
|
534
|
-
*/
|
|
535
|
-
get radios(): HTMLElement[];
|
|
536
|
-
/**
|
|
537
|
-
* Returns the currently selected radio in the radiogroup if any.
|
|
538
|
-
*/
|
|
539
|
-
get selectedRadio(): HTMLElement | null;
|
|
540
|
-
}
|
|
541
|
-
interface SelectOpenOpts {
|
|
542
|
-
/**
|
|
543
|
-
* What interaction type to use when opening the select. Defaults to the interaction type set on the tester.
|
|
544
|
-
*/
|
|
545
|
-
interactionType?: UserOpts['interactionType'];
|
|
546
|
-
}
|
|
547
|
-
interface SelectTriggerOptionOpts extends SelectOpenOpts {
|
|
548
|
-
/**
|
|
549
|
-
* The index, text, or node of the option to select. Option nodes can be sourced via `options()`.
|
|
550
|
-
*/
|
|
551
|
-
option: number | string | HTMLElement;
|
|
552
|
-
}
|
|
553
|
-
export class SelectTester {
|
|
554
|
-
constructor(opts: SelectTesterOpts);
|
|
555
|
-
/**
|
|
556
|
-
* Set the interaction type used by the select tester.
|
|
557
|
-
*/
|
|
558
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
559
|
-
/**
|
|
560
|
-
* Opens the select. Defaults to using the interaction type set on the select tester.
|
|
561
|
-
*/
|
|
562
|
-
open(opts?: SelectOpenOpts): Promise<void>;
|
|
563
|
-
/**
|
|
564
|
-
* Closes the select.
|
|
565
|
-
*/
|
|
566
|
-
close(): Promise<void>;
|
|
567
|
-
/**
|
|
568
|
-
* Returns a option matching the specified index or text content.
|
|
569
|
-
*/
|
|
570
|
-
findOption(opts: {
|
|
571
|
-
optionIndexOrText: number | string;
|
|
572
|
-
}): HTMLElement;
|
|
573
|
-
/**
|
|
574
|
-
* Selects the desired select option. Defaults to using the interaction type set on the select tester. If necessary, will open the select dropdown beforehand.
|
|
575
|
-
* The desired option can be targeted via the option's node, the option's text, or the option's index.
|
|
576
|
-
*/
|
|
577
|
-
selectOption(opts: SelectTriggerOptionOpts): Promise<void>;
|
|
578
|
-
/**
|
|
579
|
-
* Returns the select's options if present. Can be filtered to a subsection of the listbox if provided via `element`.
|
|
580
|
-
*/
|
|
581
|
-
options(opts?: {
|
|
582
|
-
element?: HTMLElement;
|
|
583
|
-
}): HTMLElement[];
|
|
584
|
-
/**
|
|
585
|
-
* Returns the select's trigger.
|
|
586
|
-
*/
|
|
587
|
-
get trigger(): HTMLElement;
|
|
588
|
-
/**
|
|
589
|
-
* Returns the select's listbox if present.
|
|
590
|
-
*/
|
|
591
|
-
get listbox(): HTMLElement | null;
|
|
592
|
-
/**
|
|
593
|
-
* Returns the select's sections if present.
|
|
594
|
-
*/
|
|
595
|
-
get sections(): HTMLElement[];
|
|
596
|
-
}
|
|
597
|
-
interface TableToggleRowOpts extends ToggleGridRowOpts {
|
|
598
|
-
}
|
|
599
|
-
interface TableToggleSortOpts {
|
|
600
|
-
/**
|
|
601
|
-
* The index, text, or node of the column to toggle selection for.
|
|
602
|
-
*/
|
|
603
|
-
column: number | string | HTMLElement;
|
|
604
|
-
/**
|
|
605
|
-
* What interaction type to use when sorting the column. Defaults to the interaction type set on the tester.
|
|
606
|
-
*/
|
|
607
|
-
interactionType?: UserOpts['interactionType'];
|
|
608
|
-
}
|
|
609
|
-
interface TableColumnHeaderActionOpts extends TableToggleSortOpts {
|
|
610
|
-
/**
|
|
611
|
-
* The index of the column header action to trigger.
|
|
612
|
-
*/
|
|
613
|
-
action: number;
|
|
614
|
-
}
|
|
615
|
-
interface TableRowActionOpts extends GridRowActionOpts {
|
|
616
|
-
}
|
|
617
|
-
export class TableTester {
|
|
618
|
-
constructor(opts: TableTesterOpts);
|
|
619
|
-
/**
|
|
620
|
-
* Set the interaction type used by the table tester.
|
|
621
|
-
*/
|
|
622
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
623
|
-
/**
|
|
624
|
-
* Toggles the selection for the specified table row. Defaults to using the interaction type set on the table tester.
|
|
625
|
-
*/
|
|
626
|
-
toggleRowSelection(opts: TableToggleRowOpts): Promise<void>;
|
|
627
|
-
/**
|
|
628
|
-
* Toggles the sort order for the specified table column. Defaults to using the interaction type set on the table tester.
|
|
629
|
-
*/
|
|
630
|
-
toggleSort(opts: TableToggleSortOpts): Promise<void>;
|
|
631
|
-
/**
|
|
632
|
-
* Triggers an action for the specified table column menu. Defaults to using the interaction type set on the table tester.
|
|
633
|
-
*/
|
|
634
|
-
triggerColumnHeaderAction(opts: TableColumnHeaderActionOpts): Promise<void>;
|
|
635
|
-
/**
|
|
636
|
-
* Triggers the action for the specified table row. Defaults to using the interaction type set on the table tester.
|
|
637
|
-
*/
|
|
638
|
-
triggerRowAction(opts: TableRowActionOpts): Promise<void>;
|
|
639
|
-
/**
|
|
640
|
-
* Toggle selection for all rows in the table. Defaults to using the interaction type set on the table tester.
|
|
641
|
-
*/
|
|
642
|
-
toggleSelectAll(opts?: {
|
|
643
|
-
interactionType?: UserOpts['interactionType'];
|
|
644
|
-
}): Promise<void>;
|
|
645
|
-
/**
|
|
646
|
-
* Returns a row matching the specified index or text content.
|
|
647
|
-
*/
|
|
648
|
-
findRow(opts: {
|
|
649
|
-
rowIndexOrText: number | string;
|
|
650
|
-
}): HTMLElement;
|
|
651
|
-
/**
|
|
652
|
-
* Returns a cell matching the specified text content.
|
|
653
|
-
*/
|
|
654
|
-
findCell(opts: {
|
|
655
|
-
text: string;
|
|
656
|
-
}): HTMLElement;
|
|
657
|
-
/**
|
|
658
|
-
* Returns the table.
|
|
659
|
-
*/
|
|
660
|
-
get table(): HTMLElement;
|
|
661
|
-
/**
|
|
662
|
-
* Returns the row groups within the table.
|
|
663
|
-
*/
|
|
664
|
-
get rowGroups(): HTMLElement[];
|
|
665
|
-
/**
|
|
666
|
-
* Returns the columns within the table.
|
|
667
|
-
*/
|
|
668
|
-
get columns(): HTMLElement[];
|
|
669
|
-
/**
|
|
670
|
-
* Returns the rows within the table if any.
|
|
671
|
-
*/
|
|
672
|
-
get rows(): HTMLElement[];
|
|
673
|
-
/**
|
|
674
|
-
* Returns the currently selected rows within the table if any.
|
|
675
|
-
*/
|
|
676
|
-
get selectedRows(): HTMLElement[];
|
|
677
|
-
/**
|
|
678
|
-
* Returns the row headers within the table if any.
|
|
679
|
-
*/
|
|
680
|
-
get rowHeaders(): HTMLElement[];
|
|
681
|
-
/**
|
|
682
|
-
* Returns the cells within the table if any. Can be filtered against a specific row if provided via `element`.
|
|
683
|
-
*/
|
|
684
|
-
cells(opts?: {
|
|
685
|
-
element?: HTMLElement;
|
|
686
|
-
}): HTMLElement[];
|
|
687
|
-
}
|
|
688
|
-
interface TriggerTabOptions {
|
|
689
|
-
/**
|
|
690
|
-
* What interaction type to use when triggering a tab. Defaults to the interaction type set on the tester.
|
|
691
|
-
*/
|
|
692
|
-
interactionType?: UserOpts['interactionType'];
|
|
693
|
-
/**
|
|
694
|
-
* The index, text, or node of the tab to toggle selection for.
|
|
695
|
-
*/
|
|
696
|
-
tab: number | string | HTMLElement;
|
|
697
|
-
/**
|
|
698
|
-
* Whether the tab needs to be activated manually rather than on focus.
|
|
699
|
-
*/
|
|
700
|
-
manualActivation?: boolean;
|
|
701
|
-
}
|
|
702
|
-
export class TabsTester {
|
|
703
|
-
constructor(opts: TabsTesterOpts);
|
|
704
|
-
/**
|
|
705
|
-
* Set the interaction type used by the tabs tester.
|
|
706
|
-
*/
|
|
707
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
708
|
-
/**
|
|
709
|
-
* Returns a tab matching the specified index or text content.
|
|
710
|
-
*/
|
|
711
|
-
findTab(opts: {
|
|
712
|
-
tabIndexOrText: number | string;
|
|
713
|
-
}): HTMLElement;
|
|
714
|
-
/**
|
|
715
|
-
* Triggers the specified tab. Defaults to using the interaction type set on the tabs tester.
|
|
716
|
-
*/
|
|
717
|
-
triggerTab(opts: TriggerTabOptions): Promise<void>;
|
|
718
|
-
/**
|
|
719
|
-
* Returns the tablist.
|
|
720
|
-
*/
|
|
721
|
-
get tablist(): HTMLElement;
|
|
722
|
-
/**
|
|
723
|
-
* Returns the tabpanels.
|
|
724
|
-
*/
|
|
725
|
-
get tabpanels(): HTMLElement[];
|
|
726
|
-
/**
|
|
727
|
-
* Returns the tabs in the tablist.
|
|
728
|
-
*/
|
|
729
|
-
get tabs(): HTMLElement[];
|
|
730
|
-
/**
|
|
731
|
-
* Returns the currently selected tab in the tablist if any.
|
|
732
|
-
*/
|
|
733
|
-
get selectedTab(): HTMLElement | null;
|
|
734
|
-
/**
|
|
735
|
-
* Returns the currently active tabpanel if any.
|
|
736
|
-
*/
|
|
737
|
-
get activeTabpanel(): HTMLElement | null;
|
|
738
|
-
}
|
|
739
|
-
interface TreeToggleExpansionOpts extends BaseGridRowInteractionOpts {
|
|
740
|
-
}
|
|
741
|
-
interface TreeToggleRowOpts extends ToggleGridRowOpts {
|
|
742
|
-
}
|
|
743
|
-
interface TreeRowActionOpts extends GridRowActionOpts {
|
|
744
|
-
}
|
|
745
|
-
export class TreeTester {
|
|
746
|
-
constructor(opts: TreeTesterOpts);
|
|
747
|
-
/**
|
|
748
|
-
* Set the interaction type used by the tree tester.
|
|
749
|
-
*/
|
|
750
|
-
setInteractionType(type: UserOpts['interactionType']): void;
|
|
751
|
-
/**
|
|
752
|
-
* Returns a row matching the specified index or text content.
|
|
753
|
-
*/
|
|
754
|
-
findRow(opts: {
|
|
755
|
-
rowIndexOrText: number | string;
|
|
756
|
-
}): HTMLElement;
|
|
757
|
-
/**
|
|
758
|
-
* Toggles the selection for the specified tree row. Defaults to using the interaction type set on the tree tester.
|
|
759
|
-
* Note that this will endevor to always add/remove JUST the provided row to the set of selected rows.
|
|
760
|
-
*/
|
|
761
|
-
toggleRowSelection(opts: TreeToggleRowOpts): Promise<void>;
|
|
762
|
-
/**
|
|
763
|
-
* Toggles the expansion for the specified tree row. Defaults to using the interaction type set on the tree tester.
|
|
764
|
-
*/
|
|
765
|
-
toggleRowExpansion(opts: TreeToggleExpansionOpts): Promise<void>;
|
|
766
|
-
/**
|
|
767
|
-
* Triggers the action for the specified tree row. Defaults to using the interaction type set on the tree tester.
|
|
768
|
-
*/
|
|
769
|
-
triggerRowAction(opts: TreeRowActionOpts): Promise<void>;
|
|
770
|
-
/**
|
|
771
|
-
* Returns the tree.
|
|
772
|
-
*/
|
|
773
|
-
get tree(): HTMLElement;
|
|
774
|
-
/**
|
|
775
|
-
* Returns the tree's rows if any.
|
|
776
|
-
*/
|
|
777
|
-
get rows(): HTMLElement[];
|
|
778
|
-
/**
|
|
779
|
-
* Returns the tree's selected rows if any.
|
|
780
|
-
*/
|
|
781
|
-
get selectedRows(): HTMLElement[];
|
|
782
|
-
/**
|
|
783
|
-
* Returns the tree's cells if any. Can be filtered against a specific row if provided via `element`.
|
|
784
|
-
*/
|
|
785
|
-
cells(opts?: {
|
|
786
|
-
element?: HTMLElement;
|
|
787
|
-
}): HTMLElement[];
|
|
788
|
-
}
|
|
789
|
-
declare let keyToUtil: {
|
|
790
|
-
'CheckboxGroup': typeof CheckboxGroupTester;
|
|
791
|
-
'ComboBox': typeof ComboBoxTester;
|
|
792
|
-
'Dialog': typeof DialogTester;
|
|
793
|
-
'GridList': typeof GridListTester;
|
|
794
|
-
'ListBox': typeof ListBoxTester;
|
|
795
|
-
'Menu': typeof MenuTester;
|
|
796
|
-
'RadioGroup': typeof RadioGroupTester;
|
|
797
|
-
'Select': typeof SelectTester;
|
|
798
|
-
'Table': typeof TableTester;
|
|
799
|
-
'Tabs': typeof TabsTester;
|
|
800
|
-
'Tree': typeof TreeTester;
|
|
801
|
-
};
|
|
802
|
-
type PatternNames = keyof typeof keyToUtil;
|
|
803
|
-
type Tester<T> = T extends 'CheckboxGroup' ? CheckboxGroupTester : T extends 'ComboBox' ? ComboBoxTester : T extends 'Dialog' ? DialogTester : T extends 'GridList' ? GridListTester : T extends 'ListBox' ? ListBoxTester : T extends 'Menu' ? MenuTester : T extends 'RadioGroup' ? RadioGroupTester : T extends 'Select' ? SelectTester : T extends 'Table' ? TableTester : T extends 'Tabs' ? TabsTester : T extends 'Tree' ? TreeTester : never;
|
|
804
|
-
type TesterOpts<T> = T extends 'CheckboxGroup' ? CheckboxGroupTesterOpts : T extends 'ComboBox' ? ComboBoxTesterOpts : T extends 'Dialog' ? DialogTesterOpts : T extends 'GridList' ? GridListTesterOpts : T extends 'ListBox' ? ListBoxTesterOpts : T extends 'Menu' ? MenuTesterOpts : T extends 'RadioGroup' ? RadioGroupTesterOpts : T extends 'Select' ? SelectTesterOpts : T extends 'Table' ? TableTesterOpts : T extends 'Tabs' ? TabsTesterOpts : T extends 'Tree' ? TreeTesterOpts : never;
|
|
805
|
-
export class User {
|
|
806
|
-
/**
|
|
807
|
-
* The interaction type (mouse, touch, keyboard) that the test util user will use when interacting with a component. This can be overridden
|
|
808
|
-
* at the aria pattern util level if needed.
|
|
809
|
-
* @default mouse
|
|
810
|
-
*/
|
|
811
|
-
interactionType: UserOpts['interactionType'];
|
|
812
|
-
/**
|
|
813
|
-
* A function used by the test utils to advance timers during interactions. Required for certain aria patterns (e.g. table).
|
|
814
|
-
*/
|
|
815
|
-
advanceTimer: UserOpts['advanceTimer'];
|
|
816
|
-
constructor(opts?: UserOpts);
|
|
817
|
-
/**
|
|
818
|
-
* Creates an aria pattern tester, inheriting the options provided to the original user.
|
|
819
|
-
*/
|
|
820
|
-
createTester<T extends PatternNames>(patternName: T, opts: TesterOpts<T>): Tester<T>;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
//# sourceMappingURL=types.d.ts.map
|