@testing-library/react-native 11.3.0 → 11.5.0
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 +5 -2
- package/build/act.js +9 -15
- package/build/act.js.map +1 -1
- package/build/cleanup.d.ts +1 -1
- package/build/cleanup.js +0 -4
- package/build/cleanup.js.map +1 -1
- package/build/config.d.ts +15 -2
- package/build/config.js +16 -8
- package/build/config.js.map +1 -1
- package/build/fireEvent.js +3 -31
- package/build/fireEvent.js.map +1 -1
- package/build/flushMicroTasks.d.ts +1 -1
- package/build/flushMicroTasks.js +0 -3
- package/build/flushMicroTasks.js.map +1 -1
- package/build/helpers/accessiblity.d.ts +10 -1
- package/build/helpers/accessiblity.js +28 -24
- package/build/helpers/accessiblity.js.map +1 -1
- package/build/helpers/component-tree.js +6 -27
- package/build/helpers/component-tree.js.map +1 -1
- package/build/helpers/debugDeep.d.ts +5 -1
- package/build/helpers/debugDeep.js +7 -6
- package/build/helpers/debugDeep.js.map +1 -1
- package/build/helpers/debugShallow.js +0 -5
- package/build/helpers/debugShallow.js.map +1 -1
- package/build/helpers/errors.js +4 -25
- package/build/helpers/errors.js.map +1 -1
- package/build/helpers/filterNodeByType.js +0 -2
- package/build/helpers/filterNodeByType.js.map +1 -1
- package/build/helpers/findAll.d.ts +10 -0
- package/build/helpers/findAll.js +44 -0
- package/build/helpers/findAll.js.map +1 -0
- package/build/helpers/format.d.ts +5 -1
- package/build/helpers/format.js +17 -7
- package/build/helpers/format.js.map +1 -1
- package/build/helpers/getTextContent.d.ts +2 -0
- package/build/helpers/getTextContent.js +20 -0
- package/build/helpers/getTextContent.js.map +1 -0
- package/build/helpers/matchers/accessibilityState.d.ts +3 -0
- package/build/helpers/matchers/accessibilityState.js +28 -0
- package/build/helpers/matchers/accessibilityState.js.map +1 -0
- package/build/helpers/matchers/accessibilityValue.d.ts +9 -0
- package/build/helpers/matchers/accessibilityValue.js +12 -0
- package/build/helpers/matchers/accessibilityValue.js.map +1 -0
- package/build/helpers/matchers/matchArrayProp.js +0 -3
- package/build/helpers/matchers/matchArrayProp.js.map +1 -1
- package/build/helpers/matchers/matchObjectProp.js +0 -2
- package/build/helpers/matchers/matchObjectProp.js.map +1 -1
- package/build/helpers/matchers/matchStringProp.js +0 -3
- package/build/helpers/matchers/matchStringProp.js.map +1 -1
- package/build/helpers/matchers/matchTextContent.d.ts +3 -0
- package/build/helpers/matchers/matchTextContent.js +22 -0
- package/build/helpers/matchers/matchTextContent.js.map +1 -0
- package/build/helpers/stringValidation.js +0 -7
- package/build/helpers/stringValidation.js.map +1 -1
- package/build/helpers/timers.js +10 -21
- package/build/helpers/timers.js.map +1 -1
- package/build/index.flow.js +169 -56
- package/build/index.js +0 -6
- package/build/index.js.map +1 -1
- package/build/matches.d.ts +7 -3
- package/build/matches.js +2 -4
- package/build/matches.js.map +1 -1
- package/build/pure.d.ts +12 -23
- package/build/pure.js +8 -15
- package/build/pure.js.map +1 -1
- package/build/queries/a11yState.d.ts +15 -14
- package/build/queries/a11yState.js +16 -13
- package/build/queries/a11yState.js.map +1 -1
- package/build/queries/a11yValue.d.ts +15 -20
- package/build/queries/a11yValue.js +16 -13
- package/build/queries/a11yValue.js.map +1 -1
- package/build/queries/displayValue.d.ts +11 -9
- package/build/queries/displayValue.js +2 -12
- package/build/queries/displayValue.js.map +1 -1
- package/build/queries/hintText.d.ts +23 -20
- package/build/queries/hintText.js +11 -11
- package/build/queries/hintText.js.map +1 -1
- package/build/queries/labelText.d.ts +11 -8
- package/build/queries/labelText.js +11 -11
- package/build/queries/labelText.js.map +1 -1
- package/build/queries/makeQueries.d.ts +9 -9
- package/build/queries/makeQueries.js +40 -24
- package/build/queries/makeQueries.js.map +1 -1
- package/build/queries/options.d.ts +11 -0
- package/build/queries/options.js +2 -0
- package/build/queries/options.js.map +1 -0
- package/build/queries/placeholderText.d.ts +11 -9
- package/build/queries/placeholderText.js +2 -12
- package/build/queries/placeholderText.js.map +1 -1
- package/build/queries/role.d.ts +7 -3
- package/build/queries/role.js +32 -13
- package/build/queries/role.js.map +1 -1
- package/build/queries/testId.d.ts +11 -9
- package/build/queries/testId.js +3 -11
- package/build/queries/testId.js.map +1 -1
- package/build/queries/text.d.ts +11 -13
- package/build/queries/text.js +6 -71
- package/build/queries/text.js.map +1 -1
- package/build/queries/unsafeProps.d.ts +1 -1
- package/build/queries/unsafeProps.js +2 -11
- package/build/queries/unsafeProps.js.map +1 -1
- package/build/queries/unsafeType.d.ts +1 -1
- package/build/queries/unsafeType.js +2 -9
- package/build/queries/unsafeType.js.map +1 -1
- package/build/react-versions.js +0 -4
- package/build/react-versions.js.map +1 -1
- package/build/render.d.ts +88 -141
- package/build/render.js +21 -31
- package/build/render.js.map +1 -1
- package/build/renderHook.d.ts +2 -2
- package/build/renderHook.js +2 -12
- package/build/renderHook.js.map +1 -1
- package/build/screen.js +0 -6
- package/build/screen.js.map +1 -1
- package/build/shallow.js +0 -6
- package/build/shallow.js.map +1 -1
- package/build/waitFor.d.ts +1 -1
- package/build/waitFor.js +29 -52
- package/build/waitFor.js.map +1 -1
- package/build/waitForElementToBeRemoved.js +2 -11
- package/build/waitForElementToBeRemoved.js.map +1 -1
- package/build/within.d.ts +84 -138
- package/build/within.js +2 -14
- package/build/within.js.map +1 -1
- package/package.json +12 -11
- package/typings/index.flow.js +169 -56
package/typings/index.flow.js
CHANGED
|
@@ -8,6 +8,10 @@ type QueryAllReturn = Array<ReactTestInstance> | [];
|
|
|
8
8
|
type FindReturn = Promise<ReactTestInstance>;
|
|
9
9
|
type FindAllReturn = Promise<ReactTestInstance[]>;
|
|
10
10
|
|
|
11
|
+
type CommonQueryOptions = {
|
|
12
|
+
includeHiddenElements?: boolean,
|
|
13
|
+
hidden?: boolean,
|
|
14
|
+
};
|
|
11
15
|
type TextMatch = string | RegExp;
|
|
12
16
|
|
|
13
17
|
declare type NormalizerFn = (textToNormalize: string) => string;
|
|
@@ -60,7 +64,7 @@ declare type A11yValue = {
|
|
|
60
64
|
min?: number,
|
|
61
65
|
max?: number,
|
|
62
66
|
now?: number,
|
|
63
|
-
text?:
|
|
67
|
+
text?: TextMatch,
|
|
64
68
|
};
|
|
65
69
|
|
|
66
70
|
type WaitForOptions = {
|
|
@@ -74,109 +78,123 @@ type WaitForFunction = <T = any>(
|
|
|
74
78
|
options?: WaitForOptions
|
|
75
79
|
) => Promise<T>;
|
|
76
80
|
|
|
81
|
+
type ByTextOptions = CommonQueryOptions & TextMatchOptions;
|
|
82
|
+
|
|
77
83
|
interface ByTextQueries {
|
|
78
|
-
getByText: (text: TextMatch, options?:
|
|
84
|
+
getByText: (text: TextMatch, options?: ByTextOptions) => ReactTestInstance;
|
|
79
85
|
getAllByText: (
|
|
80
86
|
text: TextMatch,
|
|
81
|
-
options?:
|
|
87
|
+
options?: ByTextOptions
|
|
82
88
|
) => Array<ReactTestInstance>;
|
|
83
89
|
queryByText: (
|
|
84
90
|
name: TextMatch,
|
|
85
|
-
options?:
|
|
91
|
+
options?: ByTextOptions
|
|
86
92
|
) => ReactTestInstance | null;
|
|
87
93
|
queryAllByText: (
|
|
88
94
|
text: TextMatch,
|
|
89
|
-
options?:
|
|
95
|
+
options?: ByTextOptions
|
|
90
96
|
) => Array<ReactTestInstance> | [];
|
|
91
97
|
findByText: (
|
|
92
98
|
text: TextMatch,
|
|
93
|
-
queryOptions?:
|
|
99
|
+
queryOptions?: ByTextOptions,
|
|
94
100
|
waitForOptions?: WaitForOptions
|
|
95
101
|
) => FindReturn;
|
|
96
102
|
findAllByText: (
|
|
97
103
|
text: TextMatch,
|
|
98
|
-
queryOptions?:
|
|
104
|
+
queryOptions?: ByTextOptions,
|
|
99
105
|
waitForOptions?: WaitForOptions
|
|
100
106
|
) => FindAllReturn;
|
|
101
107
|
}
|
|
102
108
|
|
|
109
|
+
type ByTestIdOptions = CommonQueryOptions & TextMatchOptions;
|
|
110
|
+
|
|
103
111
|
interface ByTestIdQueries {
|
|
104
112
|
getByTestId: (
|
|
105
113
|
testID: TextMatch,
|
|
106
|
-
options?:
|
|
114
|
+
options?: ByTestIdOptions
|
|
107
115
|
) => ReactTestInstance;
|
|
108
116
|
getAllByTestId: (
|
|
109
117
|
testID: TextMatch,
|
|
110
|
-
options?:
|
|
118
|
+
options?: ByTestIdOptions
|
|
111
119
|
) => Array<ReactTestInstance>;
|
|
112
|
-
queryByTestId: (
|
|
113
|
-
|
|
120
|
+
queryByTestId: (
|
|
121
|
+
testID: TextMatch,
|
|
122
|
+
options?: ByTestIdOptions
|
|
123
|
+
) => ReactTestInstance | null;
|
|
124
|
+
queryAllByTestId: (
|
|
125
|
+
testID: TextMatch,
|
|
126
|
+
options?: ByTestIdOptions
|
|
127
|
+
) => Array<ReactTestInstance> | [];
|
|
114
128
|
findByTestId: (
|
|
115
129
|
testID: TextMatch,
|
|
116
|
-
queryOptions?:
|
|
130
|
+
queryOptions?: ByTestIdOptions,
|
|
117
131
|
waitForOptions?: WaitForOptions
|
|
118
132
|
) => FindReturn;
|
|
119
133
|
findAllByTestId: (
|
|
120
134
|
testID: TextMatch,
|
|
121
|
-
queryOptions?:
|
|
135
|
+
queryOptions?: ByTestIdOptions,
|
|
122
136
|
waitForOptions?: WaitForOptions
|
|
123
137
|
) => FindAllReturn;
|
|
124
138
|
}
|
|
125
139
|
|
|
140
|
+
type ByDisplayValueOptions = CommonQueryOptions & TextMatchOptions;
|
|
141
|
+
|
|
126
142
|
interface ByDisplayValueQueries {
|
|
127
143
|
getByDisplayValue: (
|
|
128
144
|
value: TextMatch,
|
|
129
|
-
options?:
|
|
145
|
+
options?: ByDisplayValueOptions
|
|
130
146
|
) => ReactTestInstance;
|
|
131
147
|
getAllByDisplayValue: (
|
|
132
148
|
value: TextMatch,
|
|
133
|
-
options?:
|
|
149
|
+
options?: ByDisplayValueOptions
|
|
134
150
|
) => Array<ReactTestInstance>;
|
|
135
151
|
queryByDisplayValue: (
|
|
136
152
|
value: TextMatch,
|
|
137
|
-
options?:
|
|
153
|
+
options?: ByDisplayValueOptions
|
|
138
154
|
) => ReactTestInstance | null;
|
|
139
155
|
queryAllByDisplayValue: (
|
|
140
156
|
value: TextMatch,
|
|
141
|
-
options?:
|
|
157
|
+
options?: ByDisplayValueOptions
|
|
142
158
|
) => Array<ReactTestInstance> | [];
|
|
143
159
|
findByDisplayValue: (
|
|
144
160
|
value: TextMatch,
|
|
145
|
-
queryOptions?:
|
|
161
|
+
queryOptions?: ByDisplayValueOptions,
|
|
146
162
|
waitForOptions?: WaitForOptions
|
|
147
163
|
) => FindReturn;
|
|
148
164
|
findAllByDisplayValue: (
|
|
149
165
|
value: TextMatch,
|
|
150
|
-
queryOptions?:
|
|
166
|
+
queryOptions?: ByDisplayValueOptions,
|
|
151
167
|
waitForOptions?: WaitForOptions
|
|
152
168
|
) => FindAllReturn;
|
|
153
169
|
}
|
|
154
170
|
|
|
171
|
+
type ByPlaceholderTextOptions = CommonQueryOptions & TextMatchOptions;
|
|
172
|
+
|
|
155
173
|
interface ByPlaceholderTextQueries {
|
|
156
174
|
getByPlaceholderText: (
|
|
157
175
|
placeholder: TextMatch,
|
|
158
|
-
options?:
|
|
176
|
+
options?: ByPlaceholderTextOptions
|
|
159
177
|
) => ReactTestInstance;
|
|
160
178
|
getAllByPlaceholderText: (
|
|
161
179
|
placeholder: TextMatch,
|
|
162
|
-
options?:
|
|
180
|
+
options?: ByPlaceholderTextOptions
|
|
163
181
|
) => Array<ReactTestInstance>;
|
|
164
182
|
queryByPlaceholderText: (
|
|
165
183
|
placeholder: TextMatch,
|
|
166
|
-
options?:
|
|
184
|
+
options?: ByPlaceholderTextOptions
|
|
167
185
|
) => ReactTestInstance | null;
|
|
168
186
|
queryAllByPlaceholderText: (
|
|
169
187
|
placeholder: TextMatch,
|
|
170
|
-
options?:
|
|
188
|
+
options?: ByPlaceholderTextOptions
|
|
171
189
|
) => Array<ReactTestInstance> | [];
|
|
172
190
|
findByPlaceholderText: (
|
|
173
191
|
placeholder: TextMatch,
|
|
174
|
-
queryOptions?:
|
|
192
|
+
queryOptions?: ByPlaceholderTextOptions,
|
|
175
193
|
waitForOptions?: WaitForOptions
|
|
176
194
|
) => FindReturn;
|
|
177
195
|
findAllByPlaceholderText: (
|
|
178
196
|
placeholder: TextMatch,
|
|
179
|
-
queryOptions?:
|
|
197
|
+
queryOptions?: ByPlaceholderTextOptions,
|
|
180
198
|
waitForOptions?: WaitForOptions
|
|
181
199
|
) => FindAllReturn;
|
|
182
200
|
}
|
|
@@ -203,48 +221,89 @@ interface UnsafeByPropsQueries {
|
|
|
203
221
|
| [];
|
|
204
222
|
}
|
|
205
223
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
224
|
+
type ByRoleOptions = CommonQueryOptions & {
|
|
225
|
+
...A11yState,
|
|
226
|
+
name?: string,
|
|
227
|
+
value?: A11yValue,
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
type ByLabelTextOptions = CommonQueryOptions & TextMatchOptions;
|
|
231
|
+
type ByHintTextOptions = CommonQueryOptions & TextMatchOptions;
|
|
209
232
|
|
|
210
233
|
interface A11yAPI {
|
|
211
234
|
// Label
|
|
212
|
-
getByLabelText: (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
235
|
+
getByLabelText: (
|
|
236
|
+
matcher: TextMatch,
|
|
237
|
+
options?: ByLabelTextOptions
|
|
238
|
+
) => GetReturn;
|
|
239
|
+
getAllByLabelText: (
|
|
240
|
+
matcher: TextMatch,
|
|
241
|
+
options?: ByLabelTextOptions
|
|
242
|
+
) => GetAllReturn;
|
|
243
|
+
queryByLabelText: (
|
|
244
|
+
matcher: TextMatch,
|
|
245
|
+
options?: ByLabelTextOptions
|
|
246
|
+
) => QueryReturn;
|
|
247
|
+
queryAllByLabelText: (
|
|
248
|
+
matcher: TextMatch,
|
|
249
|
+
options?: ByLabelTextOptions
|
|
250
|
+
) => QueryAllReturn;
|
|
216
251
|
findByLabelText: (
|
|
217
252
|
matcher: TextMatch,
|
|
253
|
+
queryOptions?: ByLabelTextOptions,
|
|
218
254
|
waitForOptions?: WaitForOptions
|
|
219
255
|
) => FindReturn;
|
|
220
256
|
findAllByLabelText: (
|
|
221
257
|
matcher: TextMatch,
|
|
258
|
+
queryOptions?: ByLabelTextOptions,
|
|
222
259
|
waitForOptions?: WaitForOptions
|
|
223
260
|
) => FindAllReturn;
|
|
224
261
|
|
|
225
262
|
// Hint
|
|
226
|
-
getByA11yHint: (matcher: TextMatch) => GetReturn;
|
|
227
|
-
getByHintText: (matcher: TextMatch) => GetReturn;
|
|
228
|
-
getAllByA11yHint: (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
263
|
+
getByA11yHint: (matcher: TextMatch, options?: ByHintTextOptions) => GetReturn;
|
|
264
|
+
getByHintText: (matcher: TextMatch, options?: ByHintTextOptions) => GetReturn;
|
|
265
|
+
getAllByA11yHint: (
|
|
266
|
+
matcher: TextMatch,
|
|
267
|
+
options?: ByHintTextOptions
|
|
268
|
+
) => GetAllReturn;
|
|
269
|
+
getAllByHintText: (
|
|
270
|
+
matcher: TextMatch,
|
|
271
|
+
options?: ByHintTextOptions
|
|
272
|
+
) => GetAllReturn;
|
|
273
|
+
queryByA11yHint: (
|
|
274
|
+
matcher: TextMatch,
|
|
275
|
+
options?: ByHintTextOptions
|
|
276
|
+
) => QueryReturn;
|
|
277
|
+
queryByHintText: (
|
|
278
|
+
matcher: TextMatch,
|
|
279
|
+
options?: ByHintTextOptions
|
|
280
|
+
) => QueryReturn;
|
|
281
|
+
queryAllByA11yHint: (
|
|
282
|
+
matcher: TextMatch,
|
|
283
|
+
options?: ByHintTextOptions
|
|
284
|
+
) => QueryAllReturn;
|
|
285
|
+
queryAllByHintText: (
|
|
286
|
+
matcher: TextMatch,
|
|
287
|
+
options?: ByHintTextOptions
|
|
288
|
+
) => QueryAllReturn;
|
|
234
289
|
findByA11yHint: (
|
|
235
290
|
matcher: TextMatch,
|
|
291
|
+
queryOptions?: ByHintTextOptions,
|
|
236
292
|
waitForOptions?: WaitForOptions
|
|
237
293
|
) => FindReturn;
|
|
238
294
|
findByHintText: (
|
|
239
295
|
matcher: TextMatch,
|
|
296
|
+
queryOptions?: ByHintTextOptions,
|
|
240
297
|
waitForOptions?: WaitForOptions
|
|
241
298
|
) => FindReturn;
|
|
242
299
|
findAllByA11yHint: (
|
|
243
300
|
matcher: TextMatch,
|
|
301
|
+
queryOptions?: ByHintTextOptions,
|
|
244
302
|
waitForOptions?: WaitForOptions
|
|
245
303
|
) => FindAllReturn;
|
|
246
304
|
findAllByHintText: (
|
|
247
305
|
matcher: TextMatch,
|
|
306
|
+
queryOptions?: ByHintTextOptions,
|
|
248
307
|
waitForOptions?: WaitForOptions
|
|
249
308
|
) => FindAllReturn;
|
|
250
309
|
|
|
@@ -252,52 +311,80 @@ interface A11yAPI {
|
|
|
252
311
|
getByRole: (matcher: A11yRole | RegExp, role?: ByRoleOptions) => GetReturn;
|
|
253
312
|
getAllByRole: (
|
|
254
313
|
matcher: A11yRole | RegExp,
|
|
255
|
-
|
|
314
|
+
options?: ByRoleOptions
|
|
256
315
|
) => GetAllReturn;
|
|
257
316
|
queryByRole: (
|
|
258
317
|
matcher: A11yRole | RegExp,
|
|
259
|
-
|
|
318
|
+
options?: ByRoleOptions
|
|
260
319
|
) => QueryReturn;
|
|
261
320
|
queryAllByRole: (
|
|
262
321
|
matcher: A11yRole | RegExp,
|
|
263
|
-
|
|
322
|
+
options?: ByRoleOptions
|
|
264
323
|
) => QueryAllReturn;
|
|
265
324
|
findByRole: (
|
|
266
325
|
matcher: A11yRole | RegExp,
|
|
267
|
-
|
|
326
|
+
queryOptions?: ByRoleOptions,
|
|
268
327
|
waitForOptions?: WaitForOptions
|
|
269
328
|
) => FindReturn;
|
|
270
329
|
findAllByRole: (
|
|
271
330
|
matcher: A11yRole | RegExp,
|
|
272
|
-
|
|
331
|
+
queryOptions?: ByRoleOptions,
|
|
273
332
|
waitForOptions?: WaitForOptions
|
|
274
333
|
) => FindAllReturn;
|
|
275
334
|
|
|
276
335
|
// State
|
|
277
|
-
getByA11yState: (
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
336
|
+
getByA11yState: (
|
|
337
|
+
matcher: A11yState,
|
|
338
|
+
options?: CommonQueryOptions
|
|
339
|
+
) => GetReturn;
|
|
340
|
+
getAllByA11yState: (
|
|
341
|
+
matcher: A11yState,
|
|
342
|
+
options?: CommonQueryOptions
|
|
343
|
+
) => GetAllReturn;
|
|
344
|
+
queryByA11yState: (
|
|
345
|
+
matcher: A11yState,
|
|
346
|
+
options?: CommonQueryOptions
|
|
347
|
+
) => QueryReturn;
|
|
348
|
+
queryAllByA11yState: (
|
|
349
|
+
matcher: A11yState,
|
|
350
|
+
options?: CommonQueryOptions
|
|
351
|
+
) => QueryAllReturn;
|
|
281
352
|
findByA11yState: (
|
|
282
353
|
matcher: A11yState,
|
|
354
|
+
queryOptions?: CommonQueryOptions,
|
|
283
355
|
waitForOptions?: WaitForOptions
|
|
284
356
|
) => FindReturn;
|
|
285
357
|
findAllByA11yState: (
|
|
286
358
|
matcher: A11yState,
|
|
359
|
+
queryOptions?: CommonQueryOptions,
|
|
287
360
|
waitForOptions?: WaitForOptions
|
|
288
361
|
) => FindAllReturn;
|
|
289
362
|
|
|
290
363
|
// Value
|
|
291
|
-
getByA11yValue: (
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
364
|
+
getByA11yValue: (
|
|
365
|
+
matcher: A11yValue,
|
|
366
|
+
options?: CommonQueryOptions
|
|
367
|
+
) => GetReturn;
|
|
368
|
+
getAllByA11yValue: (
|
|
369
|
+
matcher: A11yValue,
|
|
370
|
+
options?: CommonQueryOptions
|
|
371
|
+
) => GetAllReturn;
|
|
372
|
+
queryByA11yValue: (
|
|
373
|
+
matcher: A11yValue,
|
|
374
|
+
options?: CommonQueryOptions
|
|
375
|
+
) => QueryReturn;
|
|
376
|
+
queryAllByA11yValue: (
|
|
377
|
+
matcher: A11yValue,
|
|
378
|
+
options?: CommonQueryOptions
|
|
379
|
+
) => QueryAllReturn;
|
|
295
380
|
findByA11yValue: (
|
|
296
381
|
matcher: A11yValue,
|
|
382
|
+
queryOptions?: CommonQueryOptions,
|
|
297
383
|
waitForOptions?: WaitForOptions
|
|
298
384
|
) => FindReturn;
|
|
299
385
|
findAllByA11yValue: (
|
|
300
386
|
matcher: A11yValue,
|
|
387
|
+
queryOptions?: CommonQueryOptions,
|
|
301
388
|
waitForOptions?: WaitForOptions
|
|
302
389
|
) => FindAllReturn;
|
|
303
390
|
}
|
|
@@ -306,8 +393,18 @@ interface Thenable {
|
|
|
306
393
|
then: (resolve: () => any, reject?: () => any) => any;
|
|
307
394
|
}
|
|
308
395
|
|
|
396
|
+
type MapPropsFunction = (
|
|
397
|
+
props: { [string]: mixed },
|
|
398
|
+
node: ReactTestRendererJSON
|
|
399
|
+
) => { [string]: mixed };
|
|
400
|
+
|
|
401
|
+
type DebugOptions = {
|
|
402
|
+
message?: string,
|
|
403
|
+
mapProps?: MapPropsFunction,
|
|
404
|
+
};
|
|
405
|
+
|
|
309
406
|
type Debug = {
|
|
310
|
-
(
|
|
407
|
+
(options?: DebugOptions | string): void,
|
|
311
408
|
shallow: (message?: string) => void,
|
|
312
409
|
};
|
|
313
410
|
|
|
@@ -370,21 +467,37 @@ declare module '@testing-library/react-native' {
|
|
|
370
467
|
|
|
371
468
|
declare interface Config {
|
|
372
469
|
asyncUtilTimeout: number;
|
|
470
|
+
defaultIncludeHiddenElements: boolean;
|
|
471
|
+
defaultDebugOptions?: $Shape<DebugOptions>;
|
|
373
472
|
}
|
|
374
473
|
|
|
375
|
-
declare
|
|
474
|
+
declare interface ConfigAliasOptions {
|
|
475
|
+
/** Alias to `defaultIncludeHiddenElements` for RTL compatibility */
|
|
476
|
+
defaultHidden: boolean;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare export var configure: (
|
|
480
|
+
options: $Shape<Config & ConfigAliasOptions>
|
|
481
|
+
) => void;
|
|
376
482
|
declare export var resetToDefaults: () => void;
|
|
377
483
|
|
|
378
484
|
declare export var act: (callback: () => void) => Thenable;
|
|
379
485
|
declare export var within: (instance: ReactTestInstance) => Queries;
|
|
380
486
|
declare export var getQueriesForElement: (
|
|
381
|
-
|
|
487
|
+
element: ReactTestInstance
|
|
382
488
|
) => Queries;
|
|
383
489
|
|
|
384
490
|
declare export var getDefaultNormalizer: (
|
|
385
491
|
normalizerConfig?: NormalizerConfig
|
|
386
492
|
) => NormalizerFn;
|
|
387
493
|
|
|
494
|
+
declare export var isHiddenFromAccessibility: (
|
|
495
|
+
element: ReactTestInstance | null
|
|
496
|
+
) => boolean;
|
|
497
|
+
declare export var isInaccessible: (
|
|
498
|
+
element: ReactTestInstance | null
|
|
499
|
+
) => boolean;
|
|
500
|
+
|
|
388
501
|
declare type RenderHookResult<Result, Props> = {
|
|
389
502
|
rerender: (props: Props) => void,
|
|
390
503
|
result: { current: Result },
|