From bd385806d4e814e6b27649accec116e2bc491d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Kap=C3=A7=C4=B1k?= Date: Fri, 1 Mar 2019 17:45:08 +0300 Subject: [PATCH 1/6] Translation #part01 of test-utilities. --- content/docs/addons-test-utils.md | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 20aae91b5..9eb5a0eeb 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: Test Araçları permalink: docs/test-utils.html layout: docs category: Reference --- -**Importing** +**Ekleme** ```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 ile ``` ## 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](http://facebook.github.io/jest/docs/en/tutorial-react.html#content). +`ReactTestUtils`, React bileşenlerini seçtiğiniz test çerçevesinde test etmeyi kolaylaştırır. Facebook'ta kolay bir şekilde JavaScript testi için [Jest](https://facebook.github.io/jest/)'i kullanmaktayız. Jest web sitesinde [React](http://facebook.github.io/jest/docs/en/tutorial-react.html#content) ile Jest'e nasıl başlayacağınızı öğrenebilirsiniz. -> Note: +> Not: > -> 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. +> Bileşenlerinizi son kullanıcılarmışcasına gibi kullanan test testlerini etkinleştirmek ve kullanabilmek için tasarlanmış [`react-testing-library`](https://git.io/react-testing-library) kullanmanızı öneririz. > -> Alternatively, Airbnb has released a testing utility called [Enzyme](http://airbnb.io/enzyme/), which makes it easy to assert, manipulate, and traverse your React Components' output. +> Alternatif olarak, Airbnb, React bileşenlerinin çıktısını belirlemenizi, değiştirmenizi ve değiştirmenizi kolaylaştıran [Enzyme](http://airbnb.io/enzyme/) adında bir test programı yayınladı. - [`act()`](#act) - [`mockComponent()`](#mockcomponent) @@ -40,17 +40,17 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 with npm - [`renderIntoDocument()`](#renderintodocument) - [`Simulate`](#simulate) -## Reference {#reference} +## Referanslar {#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. +Bileşen testlerini hazırlamak için, kodunuzu paket haline getirin ve bunu `act()` çağrısıyla içeride güncelleme gerçekleştirebilirsiniz. Bu sizin testinizi React'in tarayıcıda çalışma biçimine çok yakın bir şekilde çalıştırmanızı sağlar. ->Note +>Not > ->If you use `react-test-renderer`, it also provides an `act` export that behaves the same way. +>Eğer `react-test-renderer`'ı kullanırsanız, bu size `act` çıktısının aynı şekilde davranmasını sağlar. -For example, let's say we have this `Counter` component: +Örneğin `Counter` bileşenimizin olduğunu düşünün: ```js class App extends React.Component { @@ -60,10 +60,10 @@ class App extends React.Component { this.handleClick = this.handleClick.bind(this); } componentDidMount() { - document.title = `You clicked ${this.state.count} times`; + document.title = `${this.state.count} kez tıkladınız`; } componentDidUpdate() { - document.title = `You clicked ${this.state.count} times`; + document.title = `${this.state.count} kez tıkladınız`; } handleClick() { this.setState(state => ({ @@ -73,9 +73,9 @@ class App extends React.Component { render() { return (
-

You clicked {this.state.count} times

+

{this.state.count} kez tıkladınız

); @@ -83,7 +83,7 @@ class App extends React.Component { } ``` -Here is how we can test it: +Şu şekilde test edebiliriz: ```js{3,20-22,29-31} import React from 'react'; @@ -103,8 +103,8 @@ afterEach(() => { container = null; }); -it('can render and update a counter', () => { - // Test first render and componentDidMount +it('sayacı ekrana çizebilir ve güncelleyebilir', () => { + // İlk render ve componentDidMount'u test eder act(() => { ReactDOM.render(, container); }); @@ -113,12 +113,12 @@ 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 + // İkinci render and componentDidUpdate'u test eder act(() => { button.dispatchEvent(new MouseEvent('click', {bubbles: true})); }); - expect(label.textContent).toBe('You clicked 1 times'); - expect(document.title).toBe('You clicked 1 times'); + expect(label.textContent).toBe('1 kez tıkladınız'); + expect(document.title).toBe('1 kez tıkladınız'); }); ``` From 468c38c2a38f3aebbf16e71e91006226ff379ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Kap=C3=A7=C4=B1k?= Date: Tue, 5 Mar 2019 11:25:40 +0300 Subject: [PATCH 2/6] Translation #part02 of Test-Utilities in Turkish. --- content/docs/addons-test-utils.md | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 9eb5a0eeb..32604fa7c 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -13,15 +13,15 @@ import ReactTestUtils from 'react-dom/test-utils'; // ES6 var ReactTestUtils = require('react-dom/test-utils'); // ES5 npm ile ``` -## Overview {#overview} +## Test Araçlarına Genel Bakış {#overview} -`ReactTestUtils`, React bileşenlerini seçtiğiniz test çerçevesinde test etmeyi kolaylaştırır. Facebook'ta kolay bir şekilde JavaScript testi için [Jest](https://facebook.github.io/jest/)'i kullanmaktayız. Jest web sitesinde [React](http://facebook.github.io/jest/docs/en/tutorial-react.html#content) ile Jest'e nasıl başlayacağınızı öğrenebilirsiniz. +`ReactTestUtils`, React bileşenlerini seçtiğiniz test çerçevesinde test etmeyi kolaylaştırır. Facebook'ta kolay bir şekilde JavaScript testi için [Jest](https://facebook.github.io/jest/)'i kullanmaktayız. [Buradan](http://facebook.github.io/jest/docs/en/tutorial-react.html#content) React ile Jest'e nasıl başlayacağınız hakkında bilgi bulabilirsiniz. > Not: > -> Bileşenlerinizi son kullanıcılarmışcasına gibi kullanan test testlerini etkinleştirmek ve kullanabilmek için tasarlanmış [`react-testing-library`](https://git.io/react-testing-library) kullanmanızı öneririz. +> Bileşenlerinizi son kullanıcıymışcasına gibi kullanan testlerinizi etkinleştirmek ve kullanabilmek için tasarlanmış [`react-testing-library`](https://git.io/react-testing-library) kullanmanızı öneririz. > -> Alternatif olarak, Airbnb, React bileşenlerinin çıktısını belirlemenizi, değiştirmenizi ve değiştirmenizi kolaylaştıran [Enzyme](http://airbnb.io/enzyme/) adında bir test programı yayınladı. +> Alternatif olarak Airbnb [Enzyme](http://airbnb.io/enzyme/) adında bir test aracı yayınladı. Bu araç, React bileşenlerinizi test etmenizi, üzerinde gezinmenizi ve değiştirmenizi kolaylaştırmaktadır. - [`act()`](#act) - [`mockComponent()`](#mockcomponent) @@ -44,13 +44,13 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 npm ile ### `act()` {#act} -Bileşen testlerini hazırlamak için, kodunuzu paket haline getirin ve bunu `act()` çağrısıyla içeride güncelleme gerçekleştirebilirsiniz. Bu sizin testinizi React'in tarayıcıda çalışma biçimine çok yakın bir şekilde çalıştırmanızı sağlar. +Bileşen testlerini hazırlamak için kodunuzu paket haline getirin ve `act()`'i kullanarak bileşeniniz içersinde güncelleme yapabilirsiniz. `act()`, React'ın tarayıcıda çalışma biçimine çok yakın bir şekilde çalışmasını sağlamaktadır. >Not > >Eğer `react-test-renderer`'ı kullanırsanız, bu size `act` çıktısının aynı şekilde davranmasını sağlar. -Örneğin `Counter` bileşenimizin olduğunu düşünün: +Örneğin aşağıdaki gibi bir `Counter` bileşenimizin olduğunu düşünün: ```js class App extends React.Component { @@ -83,7 +83,7 @@ class App extends React.Component { } ``` -Şu şekilde test edebiliriz: +Bu bileşeni aşağıdaki gibi test edebiliriz: ```js{3,20-22,29-31} import React from 'react'; @@ -103,17 +103,17 @@ afterEach(() => { container = null; }); -it('sayacı ekrana çizebilir ve güncelleyebilir', () => { - // İlk render ve componentDidMount'u test eder +it('sayacı render edebilir ve güncelleyebilir', () => { + // render ve componentDidMount'u test eder act(() => { ReactDOM.render(, container); }); const button = container.querySelector('button'); const label = container.querySelector('p'); - expect(label.textContent).toBe('You clicked 0 times'); - expect(document.title).toBe('You clicked 0 times'); + expect(label.textContent).toBe('0 kez tıkladınız'); + expect(document.title).toBe('0 kez tıkladınız'); - // İkinci render and componentDidUpdate'u test eder + // render and componentDidUpdate'u test eder act(() => { button.dispatchEvent(new MouseEvent('click', {bubbles: true})); }); @@ -122,7 +122,7 @@ it('sayacı ekrana çizebilir ve güncelleyebilir', () => { }); ``` -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 konteynerı `document`e eklendiğinde DOM olaylarının gönderilmesini sağlayabilirsiniz. Ana proje iskeletinizi küçültmek için [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) gibi bir araç kullanabilirsiniz * * * @@ -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. +Sahte bir React bileşeni olarak kullanılabilmesine izin veren yöntemleri ekleyebilmek için bu metoda mock edilmiş bir bileşen modülü gönderin. Her zamanki gibi render etmesi yerine, bileşen belirtilen herhangi bir alt elemanı içeren basit bir `
` olacaktır. (Veya `mockTagName` belirtilmişse, belirtilen eleman olacaktır) -> Note: +> Not: > -> `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()` eski bir API'dır. [shallow rendering](/docs/shallow-renderer.html)'i veya [`jest.mock()`](https://facebook.github.io/jest/docs/en/tutorial-react-native.html#mock-native-modules-using-jestmock)'u kullanmanızı tavsiye ederiz. * * * @@ -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. +Eğer `element` herhangi bir React elemanı ise `true` döner. * * * @@ -162,7 +162,7 @@ isElementOfType( ) ``` -Returns `true` if `element` is a React element whose type is of a React `componentClass`. +Eğer `element`, React'ın `componentClass` tipinde olan bir React elemanı ise `true` döner. * * * @@ -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 ``). +Eğer `instance`, `div` veya `span` gibi bir DOM bileşeni ise `true` döner * * * @@ -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. +Eğer `instance`, kullanıcı tanımlı sınıf veya fonksiyon gibi bileşeni ise `true` döner. * * * @@ -195,7 +195,7 @@ isCompositeComponentWithType( ) ``` -Returns `true` if `instance` is a component whose type is of a React `componentClass`. +Eğer `instance`, React'ın `componentClass` tipinde olan bir React elemanı ise `true` döner. * * * @@ -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` içindeki tüm bileşenleri dolaşır ve `test(component)`'ın `true` olduğu tüm bileşenleri toplar. Tek başına pek kullanışlı değil, ancak diğer test araçları için basit olarak kullanılmaktadır. * * * @@ -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`. +Render edilen ağaçta, belirtilen `className` ile eşleşen bütün DOM elemanlarını bulur. * * * @@ -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)'a benzerdir, ancak sadece bir sonuç olmasını bekler ve geriye sonucu döndürür. (Birden fazla eşleşme varsa exception fırlatır). * * * @@ -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`. +Render edilen ağaçta, belirtilen `tagName` ile eşleşen bütün DOM elemanlarını bulur. * * * @@ -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)'a benzerdir, ancak sadece bir sonuç olmasını bekler ve geriye sonucu döndürür. (Birden fazla eşleşme varsa exception fırlatır). * * * @@ -273,7 +273,7 @@ scryRenderedComponentsWithType( ) ``` -Finds all instances of components with type equal to `componentClass`. +Belirtilen `componentClass`'a eşit olan bütün bileşenleri bulur. * * * @@ -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)'a benzerdir, ancak sadece bir sonuç olmasını bekler ve geriye sonucu döndürür. (Birden fazla eşleşme varsa exception fırlatır). *** @@ -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: +Bir React öğesini dökümandan ayrılmış bir DOM elemanı olarak render edin. **Bu fonksiyonun DOM'a ihtiyacı vardır.** Şuna eşdeğerdir: ```js const domContainer = document.createElement('div'); ReactDOM.render(element, domContainer); ``` -> Note: +> Not: > -> 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. +> `React`'a eklemeden **önce** global olarak hazır olan `window`, `window.document` ve `window.document.createElement`'e ihtiyacınız olacaktır. Aksi takdirde React DOM'a erişemediğini düşünecektir ve böylece `setState` gibi metodlar çalışmayacaktır. * * * -## Other Utilities {#other-utilities} +## Diğer Araçlar {#other-utilities} ### `Simulate` {#simulate} @@ -320,11 +320,11 @@ Simulate.{eventName}( ) ``` -Simulate an event dispatch on a DOM node with optional `eventData` event data. +İsteğe bağlı olan `eventData` olay verileri ile bir DOM elemanı üzerinde olay gönderimini simüle edebilirsiniz. -`Simulate` has a method for [every event that React understands](/docs/events.html#supported-events). +`Simulate`, [React'in anlayabildiği her olay](/docs/events.html#support-events) için bir metoda sahiptir. -**Clicking an element** +**Elemana tıklama** ```javascript // @@ -332,18 +332,18 @@ const node = this.button; ReactTestUtils.Simulate.click(node); ``` -**Changing the value of an input field and then pressing ENTER.** +**Input alanındaki değeri değiştirme ve ENTER'a basma** ```javascript // this.textInput = node} /> const node = this.textInput; -node.value = 'giraffe'; +node.value = 'zürafa'; ReactTestUtils.Simulate.change(node); ReactTestUtils.Simulate.keyDown(node, {key: "Enter", keyCode: 13, which: 13}); ``` -> Note +> Not > -> 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. +> React'ın sağlayamadığı ama bileşeninizde kullandığınız herhangi bir olay özelliğini (örneğin, keyCode, which, vb...) sizin sağlamanız gerekmektedir. * * * From b10cb962529ad05d68887bf647b3e381b62eb698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Kap=C3=A7=C4=B1k?= Date: Tue, 5 Mar 2019 14:50:49 +0300 Subject: [PATCH 3/6] Revert commit. --- content/docs/addons-test-utils.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 32604fa7c..142c8bc58 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -15,12 +15,13 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 npm ile ## Test Araçlarına Genel Bakış {#overview} -`ReactTestUtils`, React bileşenlerini seçtiğiniz test çerçevesinde test etmeyi kolaylaştırır. Facebook'ta kolay bir şekilde JavaScript testi için [Jest](https://facebook.github.io/jest/)'i kullanmaktayız. [Buradan](http://facebook.github.io/jest/docs/en/tutorial-react.html#content) React ile Jest'e nasıl başlayacağınız hakkında bilgi bulabilirsiniz. +`ReactTestUtils`, React bileşenlerini seçtiğiniz test çerçevesinde test etmeyi kolaylaştırır. Facebook, JavaScript testi için Jest‘i kullanmaktadır. [Buradan](http://facebook.github.io/jest/docs/en/tutorial-react.html#content) React ile Jest'e nasıl başlayacağınız hakkında bilgi bulabilirsiniz. > Not: > > Bileşenlerinizi son kullanıcıymışcasına gibi kullanan testlerinizi etkinleştirmek ve kullanabilmek için tasarlanmış [`react-testing-library`](https://git.io/react-testing-library) kullanmanızı öneririz. > + > Alternatif olarak Airbnb [Enzyme](http://airbnb.io/enzyme/) adında bir test aracı yayınladı. Bu araç, React bileşenlerinizi test etmenizi, üzerinde gezinmenizi ve değiştirmenizi kolaylaştırmaktadır. - [`act()`](#act) From 2b1635cd32b2b6fc609c26418b169befaaf33ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Kap=C3=A7=C4=B1k?= Date: Tue, 5 Mar 2019 18:31:21 +0300 Subject: [PATCH 4/6] Adapt change requests. --- content/docs/addons-test-utils.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index 142c8bc58..b85c3e8d9 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -13,16 +13,15 @@ import ReactTestUtils from 'react-dom/test-utils'; // ES6 var ReactTestUtils = require('react-dom/test-utils'); // ES5 npm ile ``` -## Test Araçlarına Genel Bakış {#overview} +## Genel Bakış {#overview} -`ReactTestUtils`, React bileşenlerini seçtiğiniz test çerçevesinde test etmeyi kolaylaştırır. Facebook, JavaScript testi için Jest‘i kullanmaktadır. [Buradan](http://facebook.github.io/jest/docs/en/tutorial-react.html#content) React ile Jest'e nasıl başlayacağınız hakkında bilgi bulabilirsiniz. +`ReactTestUtils`, React bileşenlerini seçtiğiniz test çerçevesinde test etmeyi kolaylaştırır. Facebook, JavaScript testi için Jest‘i kullanmaktadır. > Not: > -> Bileşenlerinizi son kullanıcıymışcasına gibi kullanan testlerinizi etkinleştirmek ve kullanabilmek için tasarlanmış [`react-testing-library`](https://git.io/react-testing-library) kullanmanızı öneririz. +> Bileşenlerinizi son kullanıcı kullanır gibi kullanan testler yazmanız ve etkinleştirmeniz için tasarlanmış [`react-testing-library`](https://git.io/react-testing-library) kullanmanızı öneririz. > - -> Alternatif olarak Airbnb [Enzyme](http://airbnb.io/enzyme/) adında bir test aracı yayınladı. Bu araç, React bileşenlerinizi test etmenizi, üzerinde gezinmenizi ve değiştirmenizi kolaylaştırmaktadır. +> Alternatif olarak Airbnb [Enzyme](http://airbnb.io/enzyme/) adında bir test aracı yayınladı. Bu araç, React bileşenlerinizin çıktısını test etmenizi, üzerinde gezinmenizi ve değiştirmenizi kolaylaştırmaktadır. - [`act()`](#act) - [`mockComponent()`](#mockcomponent) @@ -41,7 +40,7 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 npm ile - [`renderIntoDocument()`](#renderintodocument) - [`Simulate`](#simulate) -## Referanslar {#reference} +## Referans {#reference} ### `act()` {#act} From fe369038606045aca8cd6c1877bcf65f39ec7320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Kap=C3=A7=C4=B1k?= Date: Sat, 9 Mar 2019 22:43:27 +0300 Subject: [PATCH 5/6] Adapt change requests. --- content/docs/addons-test-utils.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index b85c3e8d9..184a0e128 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 ile - [`renderIntoDocument()`](#renderintodocument) - [`Simulate`](#simulate) -## Referans {#reference} +## Başvuru Dokümanı {#reference} ### `act()` {#act} @@ -122,7 +122,7 @@ it('sayacı render edebilir ve güncelleyebilir', () => { }); ``` -DOM konteynerı `document`e eklendiğinde DOM olaylarının gönderilmesini sağlayabilirsiniz. Ana proje iskeletinizi küçültmek için [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) gibi bir araç kullanabilirsiniz +Unutmayınız ki, `document`'a DOM container'ı eklenmediği sürece, dispatchEvent() çalışmayacaktır. Bu tarz angarya kodlarla uğraşmamak için, [`react-testing-library`](https://github.com/kentcdodds/react-testing-library) gibi bir kütüphaneyi kullanabilirsiniz. * * * @@ -135,7 +135,7 @@ mockComponent( ) ``` -Sahte bir React bileşeni olarak kullanılabilmesine izin veren yöntemleri ekleyebilmek için bu metoda mock edilmiş bir bileşen modülü gönderin. Her zamanki gibi render etmesi yerine, bileşen belirtilen herhangi bir alt elemanı içeren basit bir `
` olacaktır. (Veya `mockTagName` belirtilmişse, belirtilen eleman olacaktır) +Mock (sahte ya da taklit) bir React bileşeni olarak kullanılabilmesine izin veren yöntemleri ekleyebilmek için bu metoda mock edilmiş bir bileşen modülü gönderin. Her zamanki gibi render etmesi yerine, bileşen belirtilen herhangi bir alt elemanı içeren basit bir `
` olacaktır. (Veya `mockTagName` belirtilmişse, belirtilen eleman olacaktır) > Not: > From 7364860b3ce34fd9efd37802a2a3f5931bb54bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20Kap=C3=A7=C4=B1k?= Date: Wed, 13 Mar 2019 10:29:52 +0300 Subject: [PATCH 6/6] Fix typo in act() reference. --- 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 184a0e128..b0b629c6a 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -44,7 +44,7 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 npm ile ### `act()` {#act} -Bileşen testlerini hazırlamak için kodunuzu paket haline getirin ve `act()`'i kullanarak bileşeniniz içersinde güncelleme yapabilirsiniz. `act()`, React'ın tarayıcıda çalışma biçimine çok yakın bir şekilde çalışmasını sağlamaktadır. +Bileşen testlerini hazırlamak için kodunuzu paket haline getirin ve `act()`'i kullanarak bileşeniniz içerisinde güncelleme yapabilirsiniz. `act()`, React'ın tarayıcıda çalışma biçimine çok yakın bir şekilde çalışmasını sağlamaktadır. >Not >