@testing-library/react-native 9.1.0 → 10.0.1
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 +2 -2
- package/build/act.d.ts +3 -0
- package/build/act.js +2 -1
- package/build/act.js.map +1 -0
- package/build/cleanup.d.ts +5 -0
- package/build/cleanup.js +3 -2
- package/build/cleanup.js.map +1 -0
- package/build/fireEvent.d.ts +8 -0
- package/build/fireEvent.js +2 -1
- package/build/fireEvent.js.map +1 -0
- package/build/flushMicroTasks.d.ts +5 -0
- package/build/flushMicroTasks.js +2 -12
- package/build/flushMicroTasks.js.map +1 -0
- package/build/helpers/debugDeep.d.ts +5 -0
- package/build/helpers/debugDeep.js +4 -1
- package/build/helpers/debugDeep.js.map +1 -0
- package/build/helpers/debugShallow.d.ts +6 -0
- package/build/helpers/debugShallow.js +4 -7
- package/build/helpers/debugShallow.js.map +1 -0
- package/build/helpers/errors.d.ts +10 -0
- package/build/helpers/errors.js +29 -9
- package/build/helpers/errors.js.map +1 -0
- package/build/helpers/filterNodeByType.d.ts +3 -0
- package/build/helpers/filterNodeByType.js +2 -1
- package/build/helpers/filterNodeByType.js.map +1 -0
- package/build/helpers/format.d.ts +3 -0
- package/build/helpers/format.js +4 -3
- package/build/helpers/format.js.map +1 -0
- package/build/helpers/timers.d.ts +6 -0
- package/build/helpers/timers.js +9 -6
- package/build/helpers/timers.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.flow.js +394 -0
- package/build/index.js +2 -1
- package/build/index.js.map +1 -0
- package/build/matches.d.ts +9 -0
- package/build/matches.js +3 -2
- package/build/matches.js.map +1 -0
- package/build/{pure.js.flow → pure.d.ts} +5 -8
- package/build/pure.js +14 -31
- package/build/pure.js.map +1 -0
- package/build/queries/a11yAPI.d.ts +66 -0
- package/build/{helpers → queries}/a11yAPI.js +16 -15
- package/build/queries/a11yAPI.js.map +1 -0
- package/build/queries/displayValue.d.ts +13 -0
- package/build/{helpers/byDisplayValue.js → queries/displayValue.js} +23 -17
- package/build/queries/displayValue.js.map +1 -0
- package/build/queries/makeA11yQuery.d.ts +13 -0
- package/build/{helpers → queries}/makeA11yQuery.js +3 -2
- package/build/queries/makeA11yQuery.js.map +1 -0
- package/build/queries/makeQueries.d.ts +19 -0
- package/build/{helpers → queries}/makeQueries.js +23 -19
- package/build/queries/makeQueries.js.map +1 -0
- package/build/queries/placeholderText.d.ts +13 -0
- package/build/{helpers/byPlaceholderText.js → queries/placeholderText.js} +23 -17
- package/build/queries/placeholderText.js.map +1 -0
- package/build/queries/testId.d.ts +13 -0
- package/build/{helpers/byTestId.js → queries/testId.js} +19 -13
- package/build/queries/testId.js.map +1 -0
- package/build/queries/text.d.ts +17 -0
- package/build/{helpers/byText.js → queries/text.js} +27 -21
- package/build/queries/text.js.map +1 -0
- package/build/queries/unsafeProps.d.ts +16 -0
- package/build/queries/unsafeProps.js +58 -0
- package/build/queries/unsafeProps.js.map +1 -0
- package/build/queries/unsafeType.d.ts +9 -0
- package/build/queries/unsafeType.js +54 -0
- package/build/queries/unsafeType.js.map +1 -0
- package/build/render.d.ts +135 -0
- package/build/render.js +16 -21
- package/build/render.js.map +1 -0
- package/build/renderHook.d.ts +17 -0
- package/build/renderHook.js +57 -0
- package/build/renderHook.js.map +1 -0
- package/build/shallow.d.ts +8 -0
- package/build/shallow.js +3 -9
- package/build/shallow.js.map +1 -0
- package/build/waitFor.d.ts +8 -0
- package/build/waitFor.js +26 -22
- package/build/waitFor.js.map +1 -0
- package/build/waitForElementToBeRemoved.d.ts +2 -0
- package/build/waitForElementToBeRemoved.js +2 -1
- package/build/waitForElementToBeRemoved.js.map +1 -0
- package/build/within.d.ts +117 -0
- package/build/within.js +19 -9
- package/build/within.js.map +1 -0
- package/package.json +24 -14
- package/typings/index.flow.js +394 -0
- package/build/act.js.flow +0 -9
- package/build/cleanup.js.flow +0 -13
- package/build/fireEvent.js.flow +0 -127
- package/build/flushMicroTasks.js.flow +0 -23
- package/build/helpers/a11yAPI.js.flow +0 -241
- package/build/helpers/byDisplayValue.js.flow +0 -66
- package/build/helpers/byPlaceholderText.js.flow +0 -62
- package/build/helpers/byTestId.js.flow +0 -50
- package/build/helpers/byText.js.flow +0 -108
- package/build/helpers/debugDeep.js.flow +0 -16
- package/build/helpers/debugShallow.js.flow +0 -20
- package/build/helpers/errors.js.flow +0 -82
- package/build/helpers/filterNodeByType.js.flow +0 -1
- package/build/helpers/findByAPI.js +0 -32
- package/build/helpers/findByAPI.js.flow +0 -76
- package/build/helpers/format.js.flow +0 -10
- package/build/helpers/getByAPI.js +0 -98
- package/build/helpers/getByAPI.js.flow +0 -157
- package/build/helpers/makeA11yQuery.js.flow +0 -98
- package/build/helpers/makeQueries.js.flow +0 -165
- package/build/helpers/queryByAPI.js +0 -92
- package/build/helpers/queryByAPI.js.flow +0 -166
- package/build/helpers/timers.js.flow +0 -88
- package/build/index.js.flow +0 -18
- package/build/matches.js.flow +0 -41
- package/build/render.js.flow +0 -109
- package/build/shallow.js.flow +0 -26
- package/build/types.flow.js +0 -1
- package/build/types.flow.js.flow +0 -59
- package/build/waitFor.js.flow +0 -226
- package/build/waitForElementToBeRemoved.js.flow +0 -42
- package/build/within.js.flow +0 -18
- package/typings/index.d.ts +0 -433
package/typings/index.d.ts
DELETED
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
AccessibilityState,
|
|
4
|
-
// @ts-ignore AccessibilityStates was deprecated in RN0.62 https://reactnative.dev/blog/2020/03/26/version-0.62#breaking-changes
|
|
5
|
-
AccessibilityStates,
|
|
6
|
-
AccessibilityRole,
|
|
7
|
-
} from 'react-native';
|
|
8
|
-
import { ReactTestInstance, ReactTestRendererJSON } from 'react-test-renderer';
|
|
9
|
-
|
|
10
|
-
type GetReturn = ReactTestInstance;
|
|
11
|
-
type GetAllReturn = Array<ReactTestInstance>;
|
|
12
|
-
type QueryReturn = ReactTestInstance | null;
|
|
13
|
-
type QueryAllReturn = Array<ReactTestInstance> | [];
|
|
14
|
-
type FindReturn = Promise<ReactTestInstance>;
|
|
15
|
-
type FindAllReturn = Promise<ReactTestInstance[]>;
|
|
16
|
-
|
|
17
|
-
type TextMatch = string | RegExp;
|
|
18
|
-
|
|
19
|
-
interface GetByAPI {
|
|
20
|
-
getByText: (text: TextMatch, options?: TextMatchOptions) => ReactTestInstance;
|
|
21
|
-
getByPlaceholderText: (
|
|
22
|
-
placeholder: TextMatch,
|
|
23
|
-
options?: TextMatchOptions
|
|
24
|
-
) => ReactTestInstance;
|
|
25
|
-
getByDisplayValue: (
|
|
26
|
-
value: TextMatch,
|
|
27
|
-
options?: TextMatchOptions
|
|
28
|
-
) => ReactTestInstance;
|
|
29
|
-
getByTestId: (
|
|
30
|
-
testID: TextMatch,
|
|
31
|
-
options?: TextMatchOptions
|
|
32
|
-
) => ReactTestInstance;
|
|
33
|
-
getAllByTestId: (
|
|
34
|
-
testID: TextMatch,
|
|
35
|
-
options?: TextMatchOptions
|
|
36
|
-
) => Array<ReactTestInstance>;
|
|
37
|
-
getAllByText: (
|
|
38
|
-
text: TextMatch,
|
|
39
|
-
options?: TextMatchOptions
|
|
40
|
-
) => Array<ReactTestInstance>;
|
|
41
|
-
getAllByPlaceholderText: (
|
|
42
|
-
placeholder: TextMatch,
|
|
43
|
-
options?: TextMatchOptions
|
|
44
|
-
) => Array<ReactTestInstance>;
|
|
45
|
-
getAllByDisplayValue: (
|
|
46
|
-
value: TextMatch,
|
|
47
|
-
options?: TextMatchOptions
|
|
48
|
-
) => Array<ReactTestInstance>;
|
|
49
|
-
|
|
50
|
-
// Unsafe aliases
|
|
51
|
-
UNSAFE_getByType: <P>(type: React.ComponentType<P>) => ReactTestInstance;
|
|
52
|
-
UNSAFE_getAllByType: <P>(
|
|
53
|
-
type: React.ComponentType<P>
|
|
54
|
-
) => Array<ReactTestInstance>;
|
|
55
|
-
UNSAFE_getByProps: (props: Record<string, any>) => ReactTestInstance;
|
|
56
|
-
UNSAFE_getAllByProps: (
|
|
57
|
-
props: Record<string, any>
|
|
58
|
-
) => Array<ReactTestInstance>;
|
|
59
|
-
|
|
60
|
-
// Removed
|
|
61
|
-
/**
|
|
62
|
-
* @deprecated This function has been removed. Please use other queries.
|
|
63
|
-
*/
|
|
64
|
-
getByName: (name: React.ReactType | string) => ReactTestInstance;
|
|
65
|
-
/**
|
|
66
|
-
* @deprecated This function has been renamed to `UNSAFE_getByType`.
|
|
67
|
-
*/
|
|
68
|
-
getByType: <P>(type: React.ComponentType<P>) => ReactTestInstance;
|
|
69
|
-
/**
|
|
70
|
-
* @deprecated This function has been renamed to `UNSAFE_getByProps`.
|
|
71
|
-
*/
|
|
72
|
-
getByProps: (props: Record<string, any>) => ReactTestInstance;
|
|
73
|
-
/**
|
|
74
|
-
* @deprecated This function has been removed. Please use other queries.
|
|
75
|
-
*/
|
|
76
|
-
getAllByName: (name: React.ReactType | string) => Array<ReactTestInstance>;
|
|
77
|
-
/**
|
|
78
|
-
* @deprecated This function has been renamed to `UNSAFE_getAllByType`.
|
|
79
|
-
*/
|
|
80
|
-
getAllByType: <P>(type: React.ComponentType<P>) => Array<ReactTestInstance>;
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated This function has been renamed to `UNSAFE_getAllByProps`.
|
|
83
|
-
*/
|
|
84
|
-
getAllByProps: (props: Record<string, any>) => Array<ReactTestInstance>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interface QueryByAPI {
|
|
88
|
-
queryByText: (
|
|
89
|
-
name: TextMatch,
|
|
90
|
-
options?: TextMatchOptions
|
|
91
|
-
) => ReactTestInstance | null;
|
|
92
|
-
queryByPlaceholderText: (
|
|
93
|
-
placeholder: TextMatch,
|
|
94
|
-
options?: TextMatchOptions
|
|
95
|
-
) => ReactTestInstance | null;
|
|
96
|
-
queryByDisplayValue: (
|
|
97
|
-
value: TextMatch,
|
|
98
|
-
options?: TextMatchOptions
|
|
99
|
-
) => ReactTestInstance | null;
|
|
100
|
-
queryByTestId: (testID: TextMatch) => ReactTestInstance | null;
|
|
101
|
-
queryAllByTestId: (testID: TextMatch) => Array<ReactTestInstance> | [];
|
|
102
|
-
queryAllByText: (
|
|
103
|
-
text: TextMatch,
|
|
104
|
-
options?: TextMatchOptions
|
|
105
|
-
) => Array<ReactTestInstance> | [];
|
|
106
|
-
queryAllByPlaceholderText: (
|
|
107
|
-
placeholder: TextMatch,
|
|
108
|
-
options?: TextMatchOptions
|
|
109
|
-
) => Array<ReactTestInstance> | [];
|
|
110
|
-
queryAllByDisplayValue: (
|
|
111
|
-
value: TextMatch,
|
|
112
|
-
options?: TextMatchOptions
|
|
113
|
-
) => Array<ReactTestInstance> | [];
|
|
114
|
-
|
|
115
|
-
// Unsafe aliases
|
|
116
|
-
UNSAFE_queryByType: <P>(
|
|
117
|
-
type: React.ComponentType<P>
|
|
118
|
-
) => ReactTestInstance | null;
|
|
119
|
-
UNSAFE_queryAllByType: <P>(
|
|
120
|
-
type: React.ComponentType<P>
|
|
121
|
-
) => Array<ReactTestInstance> | [];
|
|
122
|
-
UNSAFE_queryByProps: (props: Record<string, any>) => ReactTestInstance | null;
|
|
123
|
-
UNSAFE_queryAllByProps: (
|
|
124
|
-
props: Record<string, any>
|
|
125
|
-
) => Array<ReactTestInstance> | [];
|
|
126
|
-
|
|
127
|
-
// Removed
|
|
128
|
-
/**
|
|
129
|
-
* @deprecated This function has been removed. Please use other queries.
|
|
130
|
-
*/
|
|
131
|
-
queryByName: (name: React.ReactType | string) => ReactTestInstance | null;
|
|
132
|
-
/**
|
|
133
|
-
* @deprecated This function has been renamed to `UNSAFE_queryByType`.
|
|
134
|
-
*/
|
|
135
|
-
queryByType: <P>(type: React.ComponentType<P>) => ReactTestInstance | null;
|
|
136
|
-
/**
|
|
137
|
-
* @deprecated This function has been renamed to `UNSAFE_queryByProps`.
|
|
138
|
-
*/
|
|
139
|
-
queryByProps: (props: Record<string, any>) => ReactTestInstance | null;
|
|
140
|
-
/**
|
|
141
|
-
* @deprecated This function has been removed. Please use other queries.
|
|
142
|
-
*/
|
|
143
|
-
queryAllByName: (
|
|
144
|
-
name: React.ReactType | string
|
|
145
|
-
) => Array<ReactTestInstance> | [];
|
|
146
|
-
/**
|
|
147
|
-
* @deprecated This function has been renamed to `UNSAFE_queryAllByType`.
|
|
148
|
-
*/
|
|
149
|
-
queryAllByType: <P>(
|
|
150
|
-
type: React.ComponentType<P>
|
|
151
|
-
) => Array<ReactTestInstance> | [];
|
|
152
|
-
/**
|
|
153
|
-
* @deprecated This function has been renamed to `UNSAFE_queryAllByProps`.
|
|
154
|
-
*/
|
|
155
|
-
queryAllByProps: (
|
|
156
|
-
props: Record<string, any>
|
|
157
|
-
) => Array<ReactTestInstance> | [];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
interface FindByAPI {
|
|
161
|
-
findByText: (
|
|
162
|
-
text: TextMatch,
|
|
163
|
-
queryOptions?: TextMatchOptions,
|
|
164
|
-
waitForOptions?: WaitForOptions
|
|
165
|
-
) => FindReturn;
|
|
166
|
-
findByPlaceholderText: (
|
|
167
|
-
placeholder: TextMatch,
|
|
168
|
-
queryOptions?: TextMatchOptions,
|
|
169
|
-
waitForOptions?: WaitForOptions
|
|
170
|
-
) => FindReturn;
|
|
171
|
-
findByDisplayValue: (
|
|
172
|
-
value: TextMatch,
|
|
173
|
-
queryOptions?: TextMatchOptions,
|
|
174
|
-
waitForOptions?: WaitForOptions
|
|
175
|
-
) => FindReturn;
|
|
176
|
-
findByTestId: (
|
|
177
|
-
testID: TextMatch,
|
|
178
|
-
queryOptions?: TextMatchOptions,
|
|
179
|
-
waitForOptions?: WaitForOptions
|
|
180
|
-
) => FindReturn;
|
|
181
|
-
findAllByText: (
|
|
182
|
-
text: TextMatch,
|
|
183
|
-
queryOptions?: TextMatchOptions,
|
|
184
|
-
waitForOptions?: WaitForOptions
|
|
185
|
-
) => FindAllReturn;
|
|
186
|
-
findAllByPlaceholderText: (
|
|
187
|
-
placeholder: TextMatch,
|
|
188
|
-
queryOptions?: TextMatchOptions,
|
|
189
|
-
waitForOptions?: WaitForOptions
|
|
190
|
-
) => FindAllReturn;
|
|
191
|
-
findAllByDisplayValue: (
|
|
192
|
-
value: TextMatch,
|
|
193
|
-
queryOptions?: TextMatchOptions,
|
|
194
|
-
waitForOptions?: WaitForOptions
|
|
195
|
-
) => FindAllReturn;
|
|
196
|
-
findAllByTestId: (
|
|
197
|
-
testID: TextMatch,
|
|
198
|
-
queryOptions?: TextMatchOptions,
|
|
199
|
-
waitForOptions?: WaitForOptions
|
|
200
|
-
) => FindAllReturn;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// Not yet available in DefinitelyTyped
|
|
204
|
-
export type A11yValue = {
|
|
205
|
-
min?: number;
|
|
206
|
-
max?: number;
|
|
207
|
-
now?: number;
|
|
208
|
-
text?: string;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
type A11yAPI = {
|
|
212
|
-
// Label
|
|
213
|
-
getByA11yLabel: (matcher: TextMatch) => GetReturn;
|
|
214
|
-
getByLabelText: (matcher: TextMatch) => GetReturn;
|
|
215
|
-
getAllByA11yLabel: (matcher: TextMatch) => GetAllReturn;
|
|
216
|
-
getAllByLabelText: (matcher: TextMatch) => GetAllReturn;
|
|
217
|
-
queryByA11yLabel: (matcher: TextMatch) => QueryReturn;
|
|
218
|
-
queryByLabelText: (matcher: TextMatch) => QueryReturn;
|
|
219
|
-
queryAllByA11yLabel: (matcher: TextMatch) => QueryAllReturn;
|
|
220
|
-
queryAllByLabelText: (matcher: TextMatch) => QueryAllReturn;
|
|
221
|
-
findByA11yLabel: (
|
|
222
|
-
matcher: TextMatch,
|
|
223
|
-
waitForOptions?: WaitForOptions
|
|
224
|
-
) => FindReturn;
|
|
225
|
-
findByLabelText: (
|
|
226
|
-
matcher: TextMatch,
|
|
227
|
-
waitForOptions?: WaitForOptions
|
|
228
|
-
) => FindReturn;
|
|
229
|
-
findAllByA11yLabel: (
|
|
230
|
-
matcher: TextMatch,
|
|
231
|
-
waitForOptions?: WaitForOptions
|
|
232
|
-
) => FindAllReturn;
|
|
233
|
-
findAllByLabelText: (
|
|
234
|
-
matcher: TextMatch,
|
|
235
|
-
waitForOptions?: WaitForOptions
|
|
236
|
-
) => FindAllReturn;
|
|
237
|
-
|
|
238
|
-
// Hint
|
|
239
|
-
getByA11yHint: (matcher: TextMatch) => GetReturn;
|
|
240
|
-
getByHintText: (matcher: TextMatch) => GetReturn;
|
|
241
|
-
getAllByA11yHint: (matcher: TextMatch) => GetAllReturn;
|
|
242
|
-
getAllByHintText: (matcher: TextMatch) => GetAllReturn;
|
|
243
|
-
queryByA11yHint: (matcher: TextMatch) => QueryReturn;
|
|
244
|
-
queryByHintText: (matcher: TextMatch) => QueryReturn;
|
|
245
|
-
queryAllByA11yHint: (matcher: TextMatch) => QueryAllReturn;
|
|
246
|
-
queryAllByHintText: (matcher: TextMatch) => QueryAllReturn;
|
|
247
|
-
findByA11yHint: (
|
|
248
|
-
matcher: TextMatch,
|
|
249
|
-
waitForOptions?: WaitForOptions
|
|
250
|
-
) => FindReturn;
|
|
251
|
-
findByHintText: (
|
|
252
|
-
matcher: TextMatch,
|
|
253
|
-
waitForOptions?: WaitForOptions
|
|
254
|
-
) => FindReturn;
|
|
255
|
-
findAllByA11yHint: (
|
|
256
|
-
matcher: TextMatch,
|
|
257
|
-
waitForOptions?: WaitForOptions
|
|
258
|
-
) => FindAllReturn;
|
|
259
|
-
findAllByHintText: (
|
|
260
|
-
matcher: TextMatch,
|
|
261
|
-
waitForOptions?: WaitForOptions
|
|
262
|
-
) => FindAllReturn;
|
|
263
|
-
|
|
264
|
-
// Role
|
|
265
|
-
getByA11yRole: (matcher: AccessibilityRole | RegExp) => GetReturn;
|
|
266
|
-
getByRole: (matcher: AccessibilityRole | RegExp) => GetReturn;
|
|
267
|
-
getAllByA11yRole: (matcher: AccessibilityRole | RegExp) => GetAllReturn;
|
|
268
|
-
getAllByRole: (matcher: AccessibilityRole | RegExp) => GetAllReturn;
|
|
269
|
-
queryByA11yRole: (matcher: AccessibilityRole | RegExp) => QueryReturn;
|
|
270
|
-
queryByRole: (matcher: AccessibilityRole | RegExp) => QueryReturn;
|
|
271
|
-
queryAllByA11yRole: (matcher: AccessibilityRole | RegExp) => QueryAllReturn;
|
|
272
|
-
queryAllByRole: (matcher: AccessibilityRole | RegExp) => QueryAllReturn;
|
|
273
|
-
findByA11yRole: (
|
|
274
|
-
matcher: AccessibilityRole | RegExp,
|
|
275
|
-
waitForOptions?: WaitForOptions
|
|
276
|
-
) => FindReturn;
|
|
277
|
-
findByRole: (
|
|
278
|
-
matcher: AccessibilityRole | RegExp,
|
|
279
|
-
waitForOptions?: WaitForOptions
|
|
280
|
-
) => FindReturn;
|
|
281
|
-
findAllByA11yRole: (
|
|
282
|
-
matcher: AccessibilityRole | RegExp,
|
|
283
|
-
waitForOptions?: WaitForOptions
|
|
284
|
-
) => FindAllReturn;
|
|
285
|
-
findAllByRole: (
|
|
286
|
-
matcher: AccessibilityRole | RegExp,
|
|
287
|
-
waitForOptions?: WaitForOptions
|
|
288
|
-
) => FindAllReturn;
|
|
289
|
-
|
|
290
|
-
// States
|
|
291
|
-
getByA11yStates: (
|
|
292
|
-
matcher: AccessibilityStates | Array<AccessibilityStates>
|
|
293
|
-
) => GetReturn;
|
|
294
|
-
getAllByA11yStates: (
|
|
295
|
-
matcher: AccessibilityStates | Array<AccessibilityStates>
|
|
296
|
-
) => GetAllReturn;
|
|
297
|
-
queryByA11yStates: (
|
|
298
|
-
matcher: AccessibilityStates | Array<AccessibilityStates>
|
|
299
|
-
) => QueryReturn;
|
|
300
|
-
queryAllByA11yStates: (
|
|
301
|
-
matcher: AccessibilityStates | Array<AccessibilityStates>
|
|
302
|
-
) => QueryAllReturn;
|
|
303
|
-
|
|
304
|
-
// State
|
|
305
|
-
getByA11yState: (matcher: AccessibilityState) => GetReturn;
|
|
306
|
-
getAllByA11yState: (matcher: AccessibilityState) => GetAllReturn;
|
|
307
|
-
queryByA11yState: (matcher: AccessibilityState) => QueryReturn;
|
|
308
|
-
queryAllByA11yState: (matcher: AccessibilityState) => QueryAllReturn;
|
|
309
|
-
findByA11yState: (
|
|
310
|
-
matcher: AccessibilityState,
|
|
311
|
-
waitForOptions?: WaitForOptions
|
|
312
|
-
) => FindReturn;
|
|
313
|
-
findAllByA11yState: (
|
|
314
|
-
matcher: AccessibilityState,
|
|
315
|
-
waitForOptions?: WaitForOptions
|
|
316
|
-
) => FindAllReturn;
|
|
317
|
-
|
|
318
|
-
// Value
|
|
319
|
-
getByA11yValue: (matcher: A11yValue) => GetReturn;
|
|
320
|
-
getAllByA11yValue: (matcher: A11yValue) => GetAllReturn;
|
|
321
|
-
queryByA11yValue: (matcher: A11yValue) => QueryReturn;
|
|
322
|
-
queryAllByA11yValue: (matcher: A11yValue) => QueryAllReturn;
|
|
323
|
-
findByA11yValue: (
|
|
324
|
-
matcher: A11yValue,
|
|
325
|
-
waitForOptions?: WaitForOptions
|
|
326
|
-
) => FindReturn;
|
|
327
|
-
findAllByA11yValue: (
|
|
328
|
-
matcher: A11yValue,
|
|
329
|
-
waitForOptions?: WaitForOptions
|
|
330
|
-
) => FindAllReturn;
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
export interface Thenable {
|
|
334
|
-
then: (resolve: () => any, reject?: () => any) => any;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
export interface RenderOptions {
|
|
338
|
-
wrapper?: React.ComponentType<any>;
|
|
339
|
-
createNodeMock?: (element: React.ReactElement<any>) => any;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
type Debug = {
|
|
343
|
-
(message?: string): void;
|
|
344
|
-
shallow: (message?: string) => void;
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
type Queries = GetByAPI & QueryByAPI & FindByAPI & A11yAPI;
|
|
348
|
-
|
|
349
|
-
export interface RenderAPI extends Queries {
|
|
350
|
-
update(nextElement: React.ReactElement<any>): void;
|
|
351
|
-
rerender(nextElement: React.ReactElement<any>): void;
|
|
352
|
-
unmount(nextElement?: React.ReactElement<any>): void;
|
|
353
|
-
toJSON(): ReactTestRendererJSON[] | ReactTestRendererJSON | null;
|
|
354
|
-
debug: Debug;
|
|
355
|
-
container: ReactTestInstance;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
export type FireEventFunction = (
|
|
359
|
-
element: ReactTestInstance,
|
|
360
|
-
eventName: string,
|
|
361
|
-
...data: Array<any>
|
|
362
|
-
) => any;
|
|
363
|
-
|
|
364
|
-
export type FireEventAPI = FireEventFunction & {
|
|
365
|
-
press: (element: ReactTestInstance, ...data: Array<any>) => any;
|
|
366
|
-
changeText: (element: ReactTestInstance, ...data: Array<any>) => any;
|
|
367
|
-
scroll: (element: ReactTestInstance, ...data: Array<any>) => any;
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
export declare const render: (
|
|
371
|
-
component: React.ReactElement<any>,
|
|
372
|
-
options?: RenderOptions
|
|
373
|
-
) => RenderAPI;
|
|
374
|
-
|
|
375
|
-
export declare const cleanup: () => void;
|
|
376
|
-
export declare const fireEvent: FireEventAPI;
|
|
377
|
-
|
|
378
|
-
type NormalizerFn = (textToNormalize: string) => string;
|
|
379
|
-
type NormalizerConfig = {
|
|
380
|
-
trim?: boolean;
|
|
381
|
-
collapseWhitespace?: boolean;
|
|
382
|
-
};
|
|
383
|
-
type TextMatchOptions = {
|
|
384
|
-
exact?: boolean;
|
|
385
|
-
normalizer?: NormalizerFn;
|
|
386
|
-
};
|
|
387
|
-
|
|
388
|
-
type WaitForOptions = {
|
|
389
|
-
timeout?: number;
|
|
390
|
-
interval?: number;
|
|
391
|
-
onTimeout?: (error: Error) => Error;
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
export type WaitForFunction = <T = any>(
|
|
395
|
-
expectation: () => T,
|
|
396
|
-
options?: WaitForOptions
|
|
397
|
-
) => Promise<T>;
|
|
398
|
-
|
|
399
|
-
export declare const waitFor: WaitForFunction;
|
|
400
|
-
|
|
401
|
-
export type WaitForElementToBeRemovedFunction = <T = any>(
|
|
402
|
-
expectation: () => T,
|
|
403
|
-
options?: WaitForOptions
|
|
404
|
-
) => Promise<T>;
|
|
405
|
-
|
|
406
|
-
export declare const waitForElementToBeRemoved: WaitForElementToBeRemovedFunction;
|
|
407
|
-
|
|
408
|
-
export declare const act: (callback: () => void) => Thenable;
|
|
409
|
-
export declare const within: (instance: ReactTestInstance) => Queries;
|
|
410
|
-
export declare const getQueriesForElement: (
|
|
411
|
-
instance: ReactTestInstance
|
|
412
|
-
) => Queries;
|
|
413
|
-
|
|
414
|
-
export declare const getDefaultNormalizer: (
|
|
415
|
-
normalizerConfig?: NormalizerConfig
|
|
416
|
-
) => NormalizerFn;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* @deprecated This function has been removed. Please use `waitFor` function.
|
|
420
|
-
*/
|
|
421
|
-
export declare const waitForElement: WaitForFunction;
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* @deprecated This function has been deprecated and will be removed in the next release.
|
|
425
|
-
*/
|
|
426
|
-
export declare const flushMicrotasksQueue: () => Promise<any>;
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* @deprecated This function has been removed.
|
|
430
|
-
*/
|
|
431
|
-
export declare const shallow: <P = {}>(
|
|
432
|
-
instance: ReactTestInstance | React.ReactElement<P>
|
|
433
|
-
) => { output: React.ReactElement<P> };
|