You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/addons-test-utils.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,7 +166,7 @@ isElementOfType(
166
166
)
167
167
```
168
168
169
-
Returns `true` if `element`is a React element whose type is of a React `componentClass`.
169
+
Trả về `true` if `element`là một React element mà có kiểu thuộc React `componentClass`.
170
170
171
171
* * *
172
172
@@ -176,7 +176,7 @@ Returns `true` if `element` is a React element whose type is of a React `compone
176
176
isDOMComponent(instance)
177
177
```
178
178
179
-
Returns `true`if`instance`is a DOM component (such as a `<div>`or`<span>`).
179
+
Trả về `true`nếu`instance`là một DOM component (như là `<div>`hoặc`<span>`).
180
180
181
181
* * *
182
182
@@ -186,7 +186,7 @@ Returns `true` if `instance` is a DOM component (such as a `<div>` or `<span>`).
186
186
isCompositeComponent(instance)
187
187
```
188
188
189
-
Returns `true`if`instance`is a user-defined component, such as a class or a function.
189
+
Trả về `true`nếu`instance`là một component do người dùng xác định, như là class component hoặc function component.
190
190
191
191
* * *
192
192
@@ -199,7 +199,7 @@ isCompositeComponentWithType(
199
199
)
200
200
```
201
201
202
-
Returns `true`if`instance`is a component whose type is of a React `componentClass`.
202
+
Trả về `true`nếu`instance`là một component mà có kiểu thuộc React `componentClass`.
203
203
204
204
* * *
205
205
@@ -212,7 +212,7 @@ findAllInRenderedTree(
212
212
)
213
213
```
214
214
215
-
Traverse all components in `tree`and accumulate all components where `test(component)`is`true`. This is not that useful on its own, but it's used as a primitive for other test utils.
215
+
Duyệt qua tất cả các component trong `tree`và dồn tất cả các component nơi mà `test(component)`là`true`. Điều này tuy không hữu ích cho mình, nhưng nó được sử dụng làm nền tảng cho các hộp test khác.
Like [`scryRenderedDOMComponentsWithClass()`](#scryrendereddomcomponentswithclass)but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
241
+
Như là [`scryRenderedDOMComponentsWithClass()`](#scryrendereddomcomponentswithclass)nhưng sẽ chỉ có một kết quả, và trả về một kết quả duy nhất, hoặc throw ra exception nếu có bất kỳ kết quả nào khác trùng nhau cạnh một kết quả duy nhất.
Like[`scryRenderedDOMComponentsWithTag()`](#scryrendereddomcomponentswithtag)but expects there to be one result, and returns that one result, or throws exception if there is any other number of matches besides one.
267
+
Như[`scryRenderedDOMComponentsWithTag()`](#scryrendereddomcomponentswithtag)nhưng sẽ chỉ có một kết quả, và trả về một kết quả duy nhất, hoặc throw ra exception nếu có bất kỳ kết quả nào khác trùng nhau cạnh một kết quả duy nhất.
Same as [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype)but expects there to be one result and returns that one result, or throws exception if there is any other number of matches besides one.
293
+
Tương tự như [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype)nhưng sẽ chỉ có một kết quả, và trả về một kết quả duy nhất, hoặc throw ra exception nếu có bất kỳ kết quả nào khác trùng nhau cạnh một kết quả duy nhất.
294
294
295
295
***
296
296
@@ -300,20 +300,20 @@ Same as [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) bu
300
300
renderIntoDocument(element)
301
301
```
302
302
303
-
Render a React element into a detached DOM node in the document. **This function requires a DOM.**It is effectively equivalent to:
303
+
Render một React element vào trong một node DOM riêng trong một document. **Function này yêu cầu một DOM.**Nó tương tự với:
304
304
305
305
```js
306
306
constdomContainer=document.createElement('div');
307
307
ReactDOM.render(element, domContainer);
308
308
```
309
309
310
-
> Note:
310
+
> Lưu ý:
311
311
>
312
-
> You will need to have `window`, `window.document`and`window.document.createElement`globally available **before**you import `React`. Otherwise React will think it can't access the DOM and methods like `setState`won't work.
312
+
> Bạn cần có `window`, `window.document`và`window.document.createElement`có sẵn ở toàn cục **trước khi**bạn import `React`. Nếu không, React sẽ nghĩ rằng nó không thể truy cập DOM và các phương thức như `setState`không hoạt động.
313
313
314
314
* * *
315
315
316
-
## Other Utilities {#other-utilities}
316
+
## Các tiện ích khác {#other-utilities}
317
317
318
318
### `Simulate` {#simulate}
319
319
@@ -324,19 +324,19 @@ Simulate.{eventName}(
324
324
)
325
325
```
326
326
327
-
Simulate an event dispatch on a DOM node with optional `eventData`event data.
327
+
Mô phỏng một sự kiện gửi đi trên một node DOM với tùy chọn `eventData`sự kiện của dữ liệu.
328
328
329
-
`Simulate`has a method for [every event that React understands](/docs/events.html#supported-events).
329
+
`Simulate`có một method cho [tất cả sự kiện mà React hiểu](/docs/events.html#supported-events).
> You will have to provide any event property that you're using in your component (e.g. keyCode, which, etc...) as React is not creating any of these for you.
351
+
> Bạn sẽ phải cung cấp bất kỳ sự kiện property mà bạn đang dùng trong component của bạn (v.d. keyCode, which, etc...) và React không tạo ra bất kỳ gì trong nó cho bạn.
0 commit comments