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

Translated shallow renderer #44

Merged
merged 13 commits into from Nov 6, 2019

Conversation

vermasachin
Copy link
Contributor

Translated API Reference > Shallow Renderer.

Some issues that I'm aware of and need help on:

  1. Translation for the word 'shallow'. I'm using just 'शैलो', because 'उथला' is generally used in the context of water and it's much more complicated.
  2. The first title of the page 'Importing'. Import is 'आयात', but couldn't find out present continuous translation for this.
  3. Couldn't figure out proper 'child, children' translations.
  4. For 'assert' I have used 'जांच', couldn't find better translation.

@netlify
Copy link

netlify bot commented Jul 13, 2019

Deploy preview for hi-reactjs ready!

Built with commit a3bfc05

https://deploy-preview-44--hi-reactjs.netlify.com

Copy link
Member

@arshadkazmi42 arshadkazmi42 left a comment

Choose a reason for hiding this comment

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

Great work.
I have left two small feedbacks, once those are fixed it will be good to go from my end

content/docs/addons-shallow-renderer.md Outdated Show resolved Hide resolved
content/docs/addons-shallow-renderer.md Outdated Show resolved Hide resolved
Copy link
Member

@arshadkazmi42 arshadkazmi42 left a comment

Choose a reason for hiding this comment

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

Great work 💯
For next steps @saranshkataria will be doing another round of review and we will get this merge once its approved by @saranshkataria


When writing unit tests for React, shallow rendering can be helpful. Shallow rendering lets you render a component "one level deep" and assert facts about what its render method returns, without worrying about the behavior of child components, which are not instantiated or rendered. This does not require a DOM.
React के लिए यूनिट टेस्ट लिखते समय शैलो रेंडरिंग काफ़ी उपयोगी हो सकती है। शैलो रेंडरिंग आपको एक कौम्पोनॅन्ट को "एक स्तर गहरा" रेंडर करने देता है और आपको दृढ़ता से ये जांच करने की क्षमता प्रदान करता है कि इस कौम्पोनॅन्ट का रेंडर मेथड क्या return करेगा, child कौम्पोनॅन्टस के व्यव्हार की चिंता किये बिना, जो की instantiate या रेंडर नहीं होते। इसमें DOM की आवश्यकता नहीं होती है।
Copy link
Member

Choose a reason for hiding this comment

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

दृढ़ता could be replaced by an easier to understand word?

Copy link
Member

Choose a reason for hiding this comment

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

@saranshkataria I am thinking to work on this. And we will get this merged.
How about वास्तविकता?

Copy link
Member

Choose a reason for hiding this comment

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

आपको दृढ़ता से ये जांच करने की क्षमता प्रदान करता है => और रेंडर मेथड जो रिटर्न कर रहा है उसको अस्सर्ट कर सकते हैं

Copy link
Member

Choose a reason for hiding this comment

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

sounds good

@@ -30,7 +30,7 @@ function MyComponent() {
}
```

Then you can assert:
तब आप जांच कर सकते हैं:
Copy link
Member

Choose a reason for hiding this comment

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

assert has a specific meaning to it, we should just convert it to hindi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What should we use? असर्ट or अस्सर्ट

Copy link
Member

Choose a reason for hiding this comment

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

अस्सर्ट makes more sense in my opinion, thoughts @arshadkazmi42 ?
Also, whatever is decided, please do add it in #2 as well

Copy link
Member

Choose a reason for hiding this comment

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

I was also thinking about this अस्सर्ट. Let me add this in #2

>
> We also recommend checking out Enzyme's [Shallow Rendering API](https://airbnb.io/enzyme/docs/api/shallow.html). It provides a nicer higher-level API over the same functionality.
> हम Enzyme के [शैलो रेंडरिंग API](https://airbnb.io/enzyme/docs/api/shallow.html) का भी परीक्षण करने की भी सलाह देते हैं। यह समान कार्यक्षमता पर एक अच्छा उच्च स्तरीय API प्रदान करता है।
Copy link
Member

Choose a reason for hiding this comment

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

यह समान कार्यक्षमता पर एक अच्छा उच्च स्तरीय API प्रदान करता है। -> can be simplified a bit?

Copy link
Member

Choose a reason for hiding this comment

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

यह उसी फंक्शनलिटी पर एक और अच्छे स्तर की API देता है ??

Copy link
Member

Choose a reason for hiding this comment

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

sounds good


### `shallowRenderer.render()` {#shallowrendererrender}

You can think of the shallowRenderer as a "place" to render the component you're testing, and from which you can extract the component's output.
आप जिस कौम्पोनॅन्ट का परीक्षण कर रहे हैं, shallowRenderer को आप उसे रेंडर करने के एक "स्थान" की तरह सोच सकते हैं, और जिससे आप कौम्पोनॅन्ट के आउटपुट को निकाल सकते हैं।
Copy link
Member

Choose a reason for hiding this comment

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

जिससे आप कौम्पोनॅन्ट -> isse aap


You can then begin to assert facts about the output.
तब आप आउटपुट के बारे में तथ्यों की जांच करना शुरू कर सकते हैं।
Copy link
Member

Choose a reason for hiding this comment

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

same comment about assert as above

@saranshkataria
Copy link
Member

Great work! Added some comments. Once we are done with those, this is good to be merged :)

@arshadkazmi42
Copy link
Member

@vermasachin Any updates on this? Let us know if you need any help with this.

@arshadkazmi42
Copy link
Member

@saranshkataria I have made suggested changes and added few comments. Can you review that? We will get this merged as only few fixes are present

@saranshkataria
Copy link
Member

@arshadkazmi42 replied to the comments, let's get this one in once you make those changes!

@arshadkazmi42
Copy link
Member

@saranshkataria Done with those changes. Let the tests complete, you check the changes and let's get this merged

@saranshkataria saranshkataria merged commit 588587a into reactjs:master Nov 6, 2019
@vermasachin vermasachin deleted the shallow-renderer branch July 16, 2020 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants