Skip to content

Commit 5185e07

Browse files
author
mel-mouk
committed
Translate 3.3
1 parent 3897db3 commit 5185e07

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

readme-fr.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,23 +1076,24 @@ test("Whenever no data is passed, error metric shows zero", () => {
10761076

10771077
<br/>
10781078

1079-
## ⚪ ️ 3.3 Whenever possible, test with a realistic and fully rendered component
1079+
## ⚪ ️ 3.3 Lorsque c'est possible, test avec un composant réaliste et totalement rendu
10801080

1081-
:white_check_mark: **Do:** Whenever reasonably sized, test your component from outside like your users do, fully render the UI, act on it and assert that the rendered UI behaves as expected. Avoid all sort of mocking, partial and shallow rendering - this approach might result in untrapped bugs due to lack of details and harden the maintenance as the tests mess with the internals (see bullet 'Favour blackbox testing'). If one of the child components is significantly slowing down (e.g. animation) or complicating the setup - consider explicitly replacing it with a fake
1081+
:white_check_mark: **Do:** Lorsqu'ils sont de taille raisonnable, tests tes composants de l'exterieur comme le font tes utilisateurs, rend complètement l'UI, agit dessus, et vérifie que l'UI rendu se comporte comme on l'attend.
1082+
Évite toute sorte de mocking, de rendu partiels ou superficiel - cette approche peut résulter en bugs non détéctés à cause du manque de détails et rendre plus difficile la maintenance des tests puisque les tests modifie les propiétés interne (voir le point 'Privilégier les tests blackbox'). Si l'un des composants enfants ralenti significativement (e.g animations) ou complique la configuration - considère de le remplacer explicitement avec un faux.
10821083

1083-
With all that said, a word of caution is in order: this technique works for small/medium components that pack a reasonable size of child components. Fully rendering a component with too many children will make it hard to reason about test failures (root cause analysis) and might get too slow. In such cases, write only a few tests against that fat parent component and more tests against its children
1084+
Maintenant que c'est dit, une mise en garde s'impose: cette technique fonctionne pour des petit/moyens composants qui ont un nombre raisonnable de composants enfants. Rendre complètement un composants avec trop d'enfant compliquera le raisonnement à propos des échecs de tests (analyse de la cause originelle) et peut être trop lent. Dans ces cas, écrit seulement quelques tests pour ce parent, et plus de tests pour ses enfants.
10841085

10851086
<br/>
10861087

1087-
**Otherwise:** When poking into a component's internal by invoking its private methods, and checking the inner state - you would have to refactor all tests when refactoring the components implementation. Do you really have a capacity for this level of maintenance?
1088+
**Autrement:** Lorsque tu fouilles dans les détails interne du composants en invoquant ses méthodes privée, et en vérifiant l'état interne - tu devra refactorer tout les tests lorsque tu refactorera l'implémentation du composants. Est-ce que tu as vraiment la capacité de tenir ce niveau de maintenance ?
10881089

10891090
<br/>
10901091

1091-
<details><summary>✏ <b>Code Examples</b></summary>
1092+
<details><summary>✏ <b>Exemple de code</b></summary>
10921093

10931094
<br/>
10941095

1095-
### :clap: Doing It Right Example: Working realistically with a fully rendered component
1096+
### :clap: Bien faire les choses, exemple: Travailler de façon réaliste sur un composant complètement rendu
10961097

10971098
![](https://img.shields.io/badge/🔧%20Example%20using%20React-blue.svg "Examples with React") ![](https://img.shields.io/badge/🔧%20Example%20using%20Enzyme-blue.svg "Examples with Enzyme")
10981099

@@ -1124,7 +1125,7 @@ test("Realistic approach: When clicked to show filters, filters are displayed",
11241125
});
11251126
```
11261127

1127-
### :thumbsdown: Anti-Pattern Example: Mocking the reality with shallow rendering
1128+
### :thumbsdown: Exemple d'anti pattern: Mocker la réalité avec un rendu superficiel
11281129

11291130
```javascript
11301131
test("Shallow/mocked approach: When clicked to show filters, filters are displayed", () => {

0 commit comments

Comments
 (0)