-
Notifications
You must be signed in to change notification settings - Fork 126
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
Conversation
Deploy preview for hi-reactjs ready! Built with commit a3bfc05 |
There was a problem hiding this 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
There was a problem hiding this 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 की आवश्यकता नहीं होती है। |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 वास्तविकता
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
आपको दृढ़ता से ये जांच करने की क्षमता प्रदान करता है
=> और रेंडर मेथड जो रिटर्न कर रहा है उसको अस्सर्ट कर सकते हैं
There was a problem hiding this comment.
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: | |||
तब आप जांच कर सकते हैं: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 अस्सर्ट
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 प्रदान करता है। |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
यह उसी फंक्शनलिटी पर एक और अच्छे स्तर की API देता है
??
There was a problem hiding this comment.
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 को आप उसे रेंडर करने के एक "स्थान" की तरह सोच सकते हैं, और जिससे आप कौम्पोनॅन्ट के आउटपुट को निकाल सकते हैं। |
There was a problem hiding this comment.
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. | ||
तब आप आउटपुट के बारे में तथ्यों की जांच करना शुरू कर सकते हैं। |
There was a problem hiding this comment.
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
Great work! Added some comments. Once we are done with those, this is good to be merged :) |
@vermasachin Any updates on this? Let us know if you need any help with this. |
@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 |
@arshadkazmi42 replied to the comments, let's get this one in once you make those changes! |
@saranshkataria Done with those changes. Let the tests complete, you check the changes and let's get this merged |
Translated API Reference > Shallow Renderer.
Some issues that I'm aware of and need help on: