Skip to content
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

Merged
merged 3 commits into from Feb 28, 2019

Conversation

jakubdrozdek
Copy link
Member

No description provided.

@jakubdrozdek jakubdrozdek added the needs review A pull request ready to be reviewed label Feb 22, 2019
@netlify
Copy link

netlify bot commented Feb 22, 2019

Deploy preview for pl-reactjs ready!

Built with commit 5132689

https://deploy-preview-25--pl-reactjs.netlify.com

content/docs/reference-test-renderer.md Outdated Show resolved Hide resolved
content/docs/reference-test-renderer.md Outdated Show resolved Hide resolved
content/docs/reference-test-renderer.md Outdated Show resolved Hide resolved
content/docs/reference-test-renderer.md Show resolved Hide resolved

### `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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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.

@jakubdrozdek
Copy link
Member Author

Poprawki naniesione - można sprawdzać.

@jakubdrozdek jakubdrozdek added feedback addressed needs +1 Needs another approval before merging labels Feb 26, 2019

### `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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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'}`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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'}`.

@cvqprs cvqprs added the needs author response Changes requested needing author's input label Feb 28, 2019
@cvqprs cvqprs added can be merged and removed needs +1 Needs another approval before merging needs author response Changes requested needing author's input needs review A pull request ready to be reviewed labels Feb 28, 2019
@jakubdrozdek jakubdrozdek merged commit ba398bf into reactjs:master Feb 28, 2019
@jakubdrozdek jakubdrozdek deleted the addons-test-renderer branch February 28, 2019 08:51
@jakubdrozdek jakubdrozdek added the 🌐 translated Translation is completed for this page label Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌐 translated Translation is completed for this page
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants