-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate 'Test Renderer' page #25
Translate 'Test Renderer' page #25
Conversation
Deploy preview for pl-reactjs ready! Built with commit 5132689 |
5d34860
to
2287720
Compare
|
||
### `TestRenderer.create()` {#testrenderercreate} | ||
|
||
```javascript | ||
TestRenderer.create(element, options); | ||
``` | ||
|
||
Create a `TestRenderer` instance with the passed React element. It doesn't use the real DOM, but it still fully renders the component tree into memory so you can make assertions about it. The returned instance has the following methods and properties. | ||
Tworzy instancję `TestRenderer` przy użyciu przekazanego elementu reactowego. Nie korzysta z prawdziwego drzewa DOM, lecz renderuje całe drzewo komponentów do pamięci, aby można było wykonać na nim sprawdzenia. Zwracana instancja posiada następujące metody i właściwości: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something to consider: https://sjp.pwn.pl/sjp/asercja;2441506.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fakt. Myślałem, że to kalka językowa, a tu proszę - nawet na Wikipedii jest o tym artykuł :-) Poprawione.
Poprawki naniesione - można sprawdzać. |
|
||
### `testRenderer.toJSON()` {#testrenderertojson} | ||
|
||
```javascript | ||
testRenderer.toJSON() | ||
``` | ||
|
||
Return an object representing the rendered tree. This tree only contains the platform-specific nodes like `<div>` or `<View>` and their props, but doesn't contain any user-written components. This is handy for [snapshot testing](https://facebook.github.io/jest/docs/en/snapshot-testing.html#snapshot-testing-with-jest). | ||
Zwraca obiekt reprezentujący wyrenderowane drzewo. W drzewie znajdą się wyłącznie węzły specyficzne dla platformy, np. `<div>` lub `<View>`, wraz ze swoimi atrybutami. Nie zostaną wyrenderowane natomiast żadne niestandardowe komponenty użytkownika. Funkcja przydaje się przy [testowaniu za pomocą snapshotów](https://facebook.github.io/jest/docs/en/snapshot-testing.html#snapshot-testing-with-jest). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zwraca obiekt reprezentujący wyrenderowane drzewo. W drzewie znajdą się wyłącznie węzły specyficzne dla platformy, np. `<div>` lub `<View>`, wraz ze swoimi atrybutami. Nie zostaną wyrenderowane natomiast żadne niestandardowe komponenty użytkownika. Funkcja przydaje się przy [testowaniu za pomocą snapshotów](https://facebook.github.io/jest/docs/en/snapshot-testing.html#snapshot-testing-with-jest). | |
Zwraca obiekt reprezentujący wyrenderowane drzewo. W drzewie znajdą się wyłącznie węzły specyficzne dla platformy, np. `<div>` lub `<View>`, wraz ze swoimi właściwościami. Nie zostaną wyrenderowane natomiast żadne niestandardowe komponenty użytkownika. Funkcja przydaje się przy [testowaniu za pomocą snapshotów](https://facebook.github.io/jest/docs/en/snapshot-testing.html#snapshot-testing-with-jest). |
|
||
### `testInstance.findByProps()` {#testinstancefindbyprops} | ||
|
||
```javascript | ||
testInstance.findByProps(props) | ||
``` | ||
|
||
Find a single descendant test instance with the provided `props`. If there is not exactly one test instance with the provided `props`, it will throw an error. | ||
Wyszukuje w poddrzewie dokładnie jedną instancję testową o podanych atrybutach `props`. Jeśli funkcja znajdzie inną liczbę instancji, rzucony zostanie wyjątek. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wyszukuje w poddrzewie dokładnie jedną instancję testową o podanych atrybutach `props`. Jeśli funkcja znajdzie inną liczbę instancji, rzucony zostanie wyjątek. | |
Wyszukuje w poddrzewie dokładnie jedną instancję testową o podanych właściwościach `props`. Jeśli funkcja znajdzie inną liczbę instancji, rzucony zostanie wyjątek. |
|
||
### `testInstance.findAllByProps()` {#testinstancefindallbyprops} | ||
|
||
```javascript | ||
testInstance.findAllByProps(props) | ||
``` | ||
|
||
Find all descendant test instances with the provided `props`. | ||
Wyszukuje w poddrzewie wszystkie instancje testowe o podanych atrybutach `props`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wyszukuje w poddrzewie wszystkie instancje testowe o podanych atrybutach `props`. | |
Wyszukuje w poddrzewie wszystkie instancje testowe o podanych właściwościach `props`. |
|
||
### `testInstance.props` {#testinstanceprops} | ||
|
||
```javascript | ||
testInstance.props | ||
``` | ||
|
||
The props corresponding to this test instance. For example, a `<Button size="small" />` component has `{size: 'small'}` as props. | ||
Zwraca atrybuty powiązane z daną instancją testową. Przykładowo, atrybutami komponentu `<Button size="small" />` są: `{size: 'small'}`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zwraca atrybuty powiązane z daną instancją testową. Przykładowo, atrybutami komponentu `<Button size="small" />` są: `{size: 'small'}`. | |
Zwraca właściwości powiązane z daną instancją testową. Przykładowo, właściwościami komponentu `<Button size="small" />` są: `{size: 'small'}`. |
No description provided.