From 2a362f824a65c9a6822ecb3bf4bbbdf5436ddc48 Mon Sep 17 00:00:00 2001 From: Nir Date: Tue, 23 Apr 2019 17:55:28 +0300 Subject: [PATCH 1/3] translate TestUtilities --- content/docs/addons-test-utils.md | 84 +++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 6cf2af081..b2c4f6df2 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -1,27 +1,27 @@ --- id: test-utils -title: Test Utilities +title: כלי בדיקה permalink: docs/test-utils.html layout: docs category: Reference --- -**Importing** +**ייבוא** ```javascript import ReactTestUtils from 'react-dom/test-utils'; // ES6 -var ReactTestUtils = require('react-dom/test-utils'); // ES5 with npm +var ReactTestUtils = require('react-dom/test-utils'); // ES5 עם npm ``` -## Overview {#overview} +## סקירה כללית {#overview} -`ReactTestUtils` makes it easy to test React components in the testing framework of your choice. At Facebook we use [Jest](https://facebook.github.io/jest/) for painless JavaScript testing. Learn how to get started with Jest through the Jest website's [React Tutorial](https://jestjs.io/docs/tutorial-react). +ReactTestUtils` מקל על תהליך בדיקת קומפוננטות ריאקט בכל פריימוורק בדיקה שתבחר. בפייסבוק אנו משתמשים ב- [Jest](https://facebook.github.io/jest/) לבדיקות ג'אווהסקריפט. למד איך להתחיל עם Jest דרך [למד איך להתחיל עם Jest דרך](https://jestjs.io/docs/tutorial-react). -> Note: +> הערה: > -> We recommend using [`react-testing-library`](https://git.io/react-testing-library) which is designed to enable and encourage writing tests that use your components as the end users do. +> אנו ממליצים להשתמש ב- [`react-testing-library`](https://git.io/react-testing-library) מכיוון שתוכננה לאפשר ולעודד כתיבת בדיקות שמשתמשות בקומפוננטות שלך בצורה זהה למשתמשים. > -> Alternatively, Airbnb has released a testing utility called [Enzyme](https://airbnb.io/enzyme/), which makes it easy to assert, manipulate, and traverse your React Components' output. +> לחלופין, Airbnb שחררו כלי בדיקה שנקרא [Enzyme](https://airbnb.io/enzyme/), שמקל על טעינת, תפעול וחצייה של פלט קומפוננטות ריאקט. - [`act()`](#act) - [`mockComponent()`](#mockcomponent) @@ -40,17 +40,17 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 with npm - [`renderIntoDocument()`](#renderintodocument) - [`Simulate`](#simulate) -## Reference {#reference} +## עיון {#reference} ### `act()` {#act} -To prepare a component for assertions, wrap the code rendering it and performing updates inside an `act()` call. This makes your test run closer to how React works in the browser. +כדי להכין קומפוננטה לטעינה, עטוף את הקוד שמרנדר אותה ומעדכן אותה בתוך קריאת `act()`. זה גורם לבדיקה שלך לרוץ קרוב לצורה שבה ריאקט עובדת בדפדפן. ->Note +>הערה > ->If you use `react-test-renderer`, it also provides an `act` export that behaves the same way. +>אם אתה משתמש ב- `react-test-renderer`, הספרייה גם מספקת מתודת `act` שמתנהגת באותה צורה. -For example, let's say we have this `Counter` component: +לדוגמה, נגיד שיש לנו את קומפוננטת `Counter` הבאה: ```js class Counter extends React.Component { @@ -83,7 +83,7 @@ class Counter extends React.Component { } ``` -Here is how we can test it: +פה נראה כיצד להריץ עליה בדיקה: ```js{3,20-22,29-31} import React from 'react'; @@ -104,7 +104,7 @@ afterEach(() => { }); it('can render and update a counter', () => { - // Test first render and componentDidMount + // בדיקת רינדור ראשון ו- componentDidMount act(() => { ReactDOM.render(, container); }); @@ -113,7 +113,7 @@ it('can render and update a counter', () => { expect(label.textContent).toBe('You clicked 0 times'); expect(document.title).toBe('You clicked 0 times'); - // Test second render and componentDidUpdate + // בדיקת רינדור שני ו- componentDidUpdate act(() => { button.dispatchEvent(new MouseEvent('click', {bubbles: true})); }); @@ -122,7 +122,7 @@ it('can render and update a counter', () => { }); ``` -Don't forget that dispatching DOM events only works when the DOM container is added to the `document`. You can use a helper like [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) to reduce the boilerplate code. +אסור לשכוח ששיגור אירועי DOM עובד רק כשקונטיינר ה- DOM נוסף ל- `document`. ניתן להשתמש בעזר כמו [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) על מנת להפחית קוד. * * * @@ -135,11 +135,11 @@ mockComponent( ) ``` -Pass a mocked component module to this method to augment it with useful methods that allow it to be used as a dummy React component. Instead of rendering as usual, the component will become a simple `
` (or other tag if `mockTagName` is provided) containing any provided children. +העבר מודול קומפוננטה ''מזוייפת'' למתודה זו על מנת להרחיב אותה עם מתודות שימושיות שנותנות את האפשרות להשתמש בה כקומפוננטת דמה. במקום לרנדר כרגיל, הקומפוננטה תהפוך ל- `
` פשוט(או תג אחר אם `mockTagName` מועברת גם) שמכיל את ה''ילדים'' המועברים. -> Note: +> הערה: > -> `mockComponent()` is a legacy API. We recommend using [shallow rendering](/docs/shallow-renderer.html) or [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) instead. +> `mockComponent()` הוא API ישן. אנו ממליצים להשתמש ב- [רינדור רדוד](/docs/shallow-renderer.html) או [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) במקום. * * * @@ -149,7 +149,7 @@ Pass a mocked component module to this method to augment it with useful methods isElement(element) ``` -Returns `true` if `element` is any React element. +מחזיר `true` אם `element` הוא אלמנט ריאקט כלשהו. * * * @@ -162,7 +162,7 @@ isElementOfType( ) ``` -Returns `true` if `element` is a React element whose type is of a React `componentClass`. +מחזיר `true` אם `element` הוא אלמנט ריאקט מסוג`componentClass` של ריאקט. * * * @@ -172,7 +172,7 @@ Returns `true` if `element` is a React element whose type is of a React `compone isDOMComponent(instance) ``` -Returns `true` if `instance` is a DOM component (such as a `
` or ``). +מחזיר `true` אם `instance` הוא קומפוננטת DOM( כמו `
` או ``). * * * @@ -182,7 +182,7 @@ Returns `true` if `instance` is a DOM component (such as a `
` or ``). isCompositeComponent(instance) ``` -Returns `true` if `instance` is a user-defined component, such as a class or a function. +מחזיר `true` אם `instance` הוא קומפוננטה שהוגדרה על ידי המשתמש, לדוגמה מחלקה או פונקצייה. * * * @@ -195,7 +195,7 @@ isCompositeComponentWithType( ) ``` -Returns `true` if `instance` is a component whose type is of a React `componentClass`. +מחזיר `true` אם `instance` הוא קומפוננטה מסוג `componentClass` של ריאקט. * * * @@ -208,7 +208,7 @@ findAllInRenderedTree( ) ``` -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. +חוצה את כל הקומפוננטות ב- `tree` וצובר את כל הקומפוננטות שבהן `test(component)` הוא `true`. זה לא כל כך שימושי בפני עצמו, אבל זה משמש כבסיס לכלי בדיקה אחרים. * * * @@ -221,7 +221,7 @@ scryRenderedDOMComponentsWithClass( ) ``` -Finds all DOM elements of components in the rendered tree that are DOM components with the class name matching `className`. +מאתר את כל אלמנטי ה- DOM של קומפוננטות בעץ המרונדר שהן קומפוננטות DOM עם שם המחלקה התואם `className`. * * * @@ -234,7 +234,7 @@ findRenderedDOMComponentWithClass( ) ``` -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. +כמו [`scryRenderedDOMComponentsWithClass()`](#scryrendereddomcomponentswithclass) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או מחזיר שגיאה אם יש מספר אחר של תוצאות. * * * @@ -247,7 +247,7 @@ scryRenderedDOMComponentsWithTag( ) ``` -Finds all DOM elements of components in the rendered tree that are DOM components with the tag name matching `tagName`. +מאתר את כל אלמנטי ה- DOM של קומפוננטות בעץ המרונדר שהן קומפוננטות DOM עם שם התג התואם `tagName`. * * * @@ -260,7 +260,7 @@ findRenderedDOMComponentWithTag( ) ``` -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. +כמו [`scryRenderedDOMComponentsWithTag()`](#scryrendereddomcomponentswithtag) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או מחזיר שגיאה אם יש מספר אחר של תוצאות. * * * @@ -273,7 +273,7 @@ scryRenderedComponentsWithType( ) ``` -Finds all instances of components with type equal to `componentClass`. +מאתר את כל מופעי הקומפוננטות שלהן סוג שווה ל- `componentClass`. * * * @@ -286,7 +286,7 @@ findRenderedComponentWithType( ) ``` -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. +כמו [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או מחזיר שגיאה אם יש מספר אחר של תוצאות. *** @@ -296,20 +296,20 @@ Same as [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) bu renderIntoDocument(element) ``` -Render a React element into a detached DOM node in the document. **This function requires a DOM.** It is effectively equivalent to: +מרנדר אלמנט ריאקט ל- DOM node מנותק בדף. **פונקצייה זו דורשת DOM נוכח.** זה שווה ערך ל: ```js const domContainer = document.createElement('div'); ReactDOM.render(element, domContainer); ``` -> Note: +> הערה: > -> 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. +> יש צורך ב- `window`, `window.document` ו- `window.document.createElement` **לפני** שמייבאים את ריאקט. אחרת ריאקט יחשוב שאין גישה ל- DOM ומתודות כמו `setState` לא יעבדו. * * * -## Other Utilities {#other-utilities} +## כלים אחרים {#other-utilities} ### `Simulate` {#simulate} @@ -320,11 +320,11 @@ Simulate.{eventName}( ) ``` -Simulate an event dispatch on a DOM node with optional `eventData` event data. +מדמה שיגור אירוע על DOM node עם `eventData` אופציונאלי. -`Simulate` has a method for [every event that React understands](/docs/events.html#supported-events). +ל- `Simulate` יש מתודה לכל [אירוע שריאקט מבין](/docs/events.html#supported-events). -**Clicking an element** +**לחיצה על אלמנט** ```javascript // @@ -332,7 +332,7 @@ const node = this.button; ReactTestUtils.Simulate.click(node); ``` -**Changing the value of an input field and then pressing ENTER.** +**שינוי ערך של שדה קלט ואז לחיצת ENTER.** ```javascript // this.textInput = node} /> @@ -342,8 +342,8 @@ ReactTestUtils.Simulate.change(node); ReactTestUtils.Simulate.keyDown(node, {key: "Enter", keyCode: 13, which: 13}); ``` -> Note +> הערה > -> 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. +> תצטרך לספק כל מאפיין אירוע שאתה משתמש בקומפוננטה שלך( כמו keyCode, which וכדומה) מכיון שריאקט לא יוצר אותם בשבילך. * * * From 7ff1a3193c6ab73ed414c44c6bdf2fe8d25b8d04 Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Tue, 30 Apr 2019 19:38:44 +0300 Subject: [PATCH 2/3] Apply suggestions from code review Co-Authored-By: galnir <36937694+galnir@users.noreply.github.com> --- content/docs/addons-test-utils.md | 54 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index b2c4f6df2..0d017a429 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -15,13 +15,13 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 עם npm ## סקירה כללית {#overview} -ReactTestUtils` מקל על תהליך בדיקת קומפוננטות ריאקט בכל פריימוורק בדיקה שתבחר. בפייסבוק אנו משתמשים ב- [Jest](https://facebook.github.io/jest/) לבדיקות ג'אווהסקריפט. למד איך להתחיל עם Jest דרך [למד איך להתחיל עם Jest דרך](https://jestjs.io/docs/tutorial-react). +`ReactTestUtils` מקל על תהליך בדיקת קומפוננטות React בכל פריימוורק בדיקה שתבחר. ב-Facebook אנו משתמשים ב-[Jest](https://facebook.github.io/jest/) לבדיקות JavaScript בצורה קלה. למד איך להתחיל עם Jest דרך [מדריך React](https://jestjs.io/docs/tutorial-react) באתר האינטרנט של Jest. > הערה: > -> אנו ממליצים להשתמש ב- [`react-testing-library`](https://git.io/react-testing-library) מכיוון שתוכננה לאפשר ולעודד כתיבת בדיקות שמשתמשות בקומפוננטות שלך בצורה זהה למשתמשים. +> אנו ממליצים להשתמש ב-[`react-testing-library`](https://git.io/react-testing-library) שתוכננה לאפשר ולעודד כתיבת בדיקות שמשתמשות בקומפוננטות שלך בצורה זהה למשתמשי הקצה. > -> לחלופין, Airbnb שחררו כלי בדיקה שנקרא [Enzyme](https://airbnb.io/enzyme/), שמקל על טעינת, תפעול וחצייה של פלט קומפוננטות ריאקט. +> לחלופין, Airbnb שחררו כלי בדיקה שנקרא [Enzyme](https://airbnb.io/enzyme/), שמקל על ווידוא, מניפולציה ומעבר על פלט קומפוננטות ה-React שלך. - [`act()`](#act) - [`mockComponent()`](#mockcomponent) @@ -44,11 +44,11 @@ ReactTestUtils` מקל על תהליך בדיקת קומפוננטות ריאק ### `act()` {#act} -כדי להכין קומפוננטה לטעינה, עטוף את הקוד שמרנדר אותה ומעדכן אותה בתוך קריאת `act()`. זה גורם לבדיקה שלך לרוץ קרוב לצורה שבה ריאקט עובדת בדפדפן. +כדי להכין קומפוננטה לווידוא, עטוף את הקוד שמרנדר אותה ומבצע עליה עדכונים בתוך קריאת `act()`. פעולה זו גורמת לבדיקה שלך לרוץ באופן דומה לצורה שבה React עובדת בדפדפן. >הערה > ->אם אתה משתמש ב- `react-test-renderer`, הספרייה גם מספקת מתודת `act` שמתנהגת באותה צורה. +>אם אתה משתמש ב-`react-test-renderer`, הספרייה גם מספקת מתודת `act` שמתנהגת באותה צורה. לדוגמה, נגיד שיש לנו את קומפוננטת `Counter` הבאה: @@ -83,7 +83,7 @@ class Counter extends React.Component { } ``` -פה נראה כיצד להריץ עליה בדיקה: +ככה נוכל לבדוק אותה: ```js{3,20-22,29-31} import React from 'react'; @@ -104,7 +104,7 @@ afterEach(() => { }); it('can render and update a counter', () => { - // בדיקת רינדור ראשון ו- componentDidMount + // בדיקת רינדור ראשון ו-componentDidMount act(() => { ReactDOM.render(, container); }); @@ -113,7 +113,7 @@ it('can render and update a counter', () => { expect(label.textContent).toBe('You clicked 0 times'); expect(document.title).toBe('You clicked 0 times'); - // בדיקת רינדור שני ו- componentDidUpdate + // בדיקת רינדור שני ו-componentDidUpdate act(() => { button.dispatchEvent(new MouseEvent('click', {bubbles: true})); }); @@ -122,7 +122,7 @@ it('can render and update a counter', () => { }); ``` -אסור לשכוח ששיגור אירועי DOM עובד רק כשקונטיינר ה- DOM נוסף ל- `document`. ניתן להשתמש בעזר כמו [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) על מנת להפחית קוד. +אסור לשכוח ששיגור אירועי DOM עובד רק כשקונטיינר ה-DOM נוסף ל-`document`. ניתן להשתמש בעזר כמו [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) על מנת להפחית קוד תבנית קבועה. * * * @@ -135,11 +135,11 @@ mockComponent( ) ``` -העבר מודול קומפוננטה ''מזוייפת'' למתודה זו על מנת להרחיב אותה עם מתודות שימושיות שנותנות את האפשרות להשתמש בה כקומפוננטת דמה. במקום לרנדר כרגיל, הקומפוננטה תהפוך ל- `
` פשוט(או תג אחר אם `mockTagName` מועברת גם) שמכיל את ה''ילדים'' המועברים. +העבר מודול קומפוננטה "מזוייפת" למתודה זו על מנת להרחיב אותה עם מתודות שימושיות שנותנות את האפשרות להשתמש בה כקומפוננטת React מדומה. במקום לרנדר כרגיל, הקומפוננטה תהפוך ל-`
` פשוט (או תג אחר אם סופק גם `mockTagName`) שמכיל את הילדים שסופקו. > הערה: > -> `mockComponent()` הוא API ישן. אנו ממליצים להשתמש ב- [רינדור רדוד](/docs/shallow-renderer.html) או [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) במקום. +> `mockComponent()` הוא API ישן. אנו ממליצים להשתמש ב-[רינדור רדוד](/docs/shallow-renderer.html) או ב-[`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock) במקום. * * * @@ -149,7 +149,7 @@ mockComponent( isElement(element) ``` -מחזיר `true` אם `element` הוא אלמנט ריאקט כלשהו. +מחזיר `true` אם `element` הוא אלמנט React כלשהו. * * * @@ -162,7 +162,7 @@ isElementOfType( ) ``` -מחזיר `true` אם `element` הוא אלמנט ריאקט מסוג`componentClass` של ריאקט. +מחזיר `true` אם `element` הוא אלמנט React מסוג `componentClass` של React. * * * @@ -172,7 +172,7 @@ isElementOfType( isDOMComponent(instance) ``` -מחזיר `true` אם `instance` הוא קומפוננטת DOM( כמו `
` או ``). +מחזיר `true` אם `instance` הוא קומפוננטת DOM (כמו `
` או ``). * * * @@ -195,7 +195,7 @@ isCompositeComponentWithType( ) ``` -מחזיר `true` אם `instance` הוא קומפוננטה מסוג `componentClass` של ריאקט. +מחזיר `true` אם `instance` הוא קומפוננטה מסוג `componentClass` של React. * * * @@ -208,7 +208,7 @@ findAllInRenderedTree( ) ``` -חוצה את כל הקומפוננטות ב- `tree` וצובר את כל הקומפוננטות שבהן `test(component)` הוא `true`. זה לא כל כך שימושי בפני עצמו, אבל זה משמש כבסיס לכלי בדיקה אחרים. +חוצה את כל הקומפוננטות ב-`tree` וצובר את כל הקומפוננטות שבהן `test(component)` הוא `true`. זה לא כל כך שימושי בפני עצמו, אבל זה משמש כבסיס לכלי בדיקה אחרים. * * * @@ -221,7 +221,7 @@ scryRenderedDOMComponentsWithClass( ) ``` -מאתר את כל אלמנטי ה- DOM של קומפוננטות בעץ המרונדר שהן קומפוננטות DOM עם שם המחלקה התואם `className`. +מאתר את כל אלמנטי ה-DOM של קומפוננטות בעץ המרונדר שהן קומפוננטות DOM עם שם המחלקה התואם `className`. * * * @@ -234,7 +234,7 @@ findRenderedDOMComponentWithClass( ) ``` -כמו [`scryRenderedDOMComponentsWithClass()`](#scryrendereddomcomponentswithclass) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או מחזיר שגיאה אם יש מספר אחר של תוצאות. +כמו [`scryRenderedDOMComponentsWithClass()`](#scryrendereddomcomponentswithclass) אבל מצפה שתהיה תוצאה אחת, ומחזיר את התוצאה האחת הזו, או זורק שגיאה אם יש מספר אחר של תוצאות מעבר לאחת. * * * @@ -247,7 +247,7 @@ scryRenderedDOMComponentsWithTag( ) ``` -מאתר את כל אלמנטי ה- DOM של קומפוננטות בעץ המרונדר שהן קומפוננטות DOM עם שם התג התואם `tagName`. +מאתר את כל אלמנטי ה-DOM של קומפוננטות בעץ המרונדר שהן קומפוננטות DOM עם שם תג התואם את `tagName`. * * * @@ -260,7 +260,7 @@ findRenderedDOMComponentWithTag( ) ``` -כמו [`scryRenderedDOMComponentsWithTag()`](#scryrendereddomcomponentswithtag) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או מחזיר שגיאה אם יש מספר אחר של תוצאות. +כמו [`scryRenderedDOMComponentsWithTag()`](#scryrendereddomcomponentswithtag) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או זורק שגיאה אם יש מספר אחר של תוצאות מעבר לאחת. * * * @@ -273,7 +273,7 @@ scryRenderedComponentsWithType( ) ``` -מאתר את כל מופעי הקומפוננטות שלהן סוג שווה ל- `componentClass`. +מאתר את כל מופעי הקומפוננטות שהסוג שלהן שווה ל-`componentClass`. * * * @@ -286,7 +286,7 @@ findRenderedComponentWithType( ) ``` -כמו [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או מחזיר שגיאה אם יש מספר אחר של תוצאות. +כמו [`scryRenderedComponentsWithType()`](#scryrenderedcomponentswithtype) אבל מצפה לתוצאה אחת, ומחזיר את התוצאה האחת הזו, או זורק שגיאה אם יש מספר אחר של תוצאות מעבר לאחת. *** @@ -296,7 +296,7 @@ findRenderedComponentWithType( renderIntoDocument(element) ``` -מרנדר אלמנט ריאקט ל- DOM node מנותק בדף. **פונקצייה זו דורשת DOM נוכח.** זה שווה ערך ל: +מרנדר אלמנט React לצומת DOM מנותקת בדף. **פונקצייה זו דורשת DOM נוכח.** זה שווה ערך ל: ```js const domContainer = document.createElement('div'); @@ -305,7 +305,7 @@ ReactDOM.render(element, domContainer); > הערה: > -> יש צורך ב- `window`, `window.document` ו- `window.document.createElement` **לפני** שמייבאים את ריאקט. אחרת ריאקט יחשוב שאין גישה ל- DOM ומתודות כמו `setState` לא יעבדו. +> יש צורך ב-`window`, `window.document` ו-`window.document.createElement` זמינים באופן גלובלי **לפני** שמייבאים את `React`. אחרת React תחשוב שאין לה גישה ל-DOM ומתודות כמו `setState` לא יעבדו. * * * @@ -320,9 +320,9 @@ Simulate.{eventName}( ) ``` -מדמה שיגור אירוע על DOM node עם `eventData` אופציונאלי. +מדמה שיגור אירוע על צומת DOM עם נתוני אירוע `eventData` אופציונאליים. -ל- `Simulate` יש מתודה לכל [אירוע שריאקט מבין](/docs/events.html#supported-events). +ל-`Simulate` יש מתודה ל[כל אירוע שReact מבינה](/docs/events.html#supported-events). **לחיצה על אלמנט** @@ -344,6 +344,6 @@ ReactTestUtils.Simulate.keyDown(node, {key: "Enter", keyCode: 13, which: 13}); > הערה > -> תצטרך לספק כל מאפיין אירוע שאתה משתמש בקומפוננטה שלך( כמו keyCode, which וכדומה) מכיון שריאקט לא יוצר אותם בשבילך. +> תצטרך לספק כל מאפיין אירוע שאתה משתמש בו בקומפוננטה שלך (כמו keyCode, which וכו') מכיון ש-React לא יוצרת אף אחד מהם עבורך. * * * From a311e78394f343e3d051ac864c2ebb529d12be5f Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Tue, 30 Apr 2019 19:58:41 -0700 Subject: [PATCH 3/3] Update addons-test-utils.md --- content/docs/addons-test-utils.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 0d017a429..cf39a5729 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -40,7 +40,7 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 עם npm - [`renderIntoDocument()`](#renderintodocument) - [`Simulate`](#simulate) -## עיון {#reference} +## סימוכין {#reference} ### `act()` {#act}