Retired
Counter (React) (retired)
Loading description...
React
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This kata is now unsolvable because Enzyme's
shallow
also callscomponentDidMount
andcomponentDidUpdate
now: https://github.com/airbnb/enzyme/blob/master/docs/api/shallow.mdWhy is default value of color
null
until it's mounted?null
is not a color.Why is this kata not using
React.Component
?we need more react kata
It is totally unclear from the description that the color of the top of the border should be set to a random color instead of the default "null" when the component is actually mounted, so this should at least be stated explicitly in the description.
But actually, the "random color" thing does not seem to add much value to this Kata and is IMO rather distracting. Perhaps consider removing it altogether?
Needs "true" random tests, on top of the current mocked
Math.random()
valuesconst wrapper = mount(); expect(wrapper.children().props().style.borderTop).toEqual('10px solid pink');
reallly not cllear what need to do with it, who can help?
bad kata i ever seen need fix Datails ( not a single word about the element div in which there should be a number value) and + and - located incorrectly
Hello, What method i need to use after "render", i tried using lifecycle methods but it didnt work?
The "increment" button has text '-' and the "decrement" button has text '+'.
Also I agree with @FArekkusu, I don't know React and
expect(wrapper.children().props().style.borderTop).toEqual('10px solid pink');
instead of nullis really confusing
It's not mentioned anywhere that the initial color should be
null
.This comment has been hidden.
The default color is
null
, why on earth is the expected color right after object creation"pink"
?Because we render the component with
mount
that runs lifecycle.This doesn't explain anything at all. For a person who doesn't know React or its testing framework (whichever is causing this behavior), this kata is going to be one huge frustrating experience. Especially when there's no indication that this piece of state is shared between tests.
No sample tests.
Fixed. Thanks!