Retired

Counter (React) (retired)

Description
Loading description...
React
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    This kata is now unsolvable because Enzyme's shallow also calls componentDidMount and componentDidUpdate now: https://github.com/airbnb/enzyme/blob/master/docs/api/shallow.md

  • Voile Avatar

    Why is default value of color null until it's mounted? null is not a color.

  • Voile Avatar

    Why is this kata not using React.Component?

  • it1shka Avatar

    we need more react kata

  • donaldsebleung Avatar

    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?

  • donaldsebleung Avatar

    Needs "true" random tests, on top of the current mocked Math.random() values

  • dimit999 Avatar

    const wrapper = mount(); expect(wrapper.children().props().style.borderTop).toEqual('10px solid pink');

    reallly not cllear what need to do with it, who can help?

  • maksim-nemtsev Avatar

    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

  • Shnyrkevich Avatar

    Hello, What method i need to use after "render", i tried using lifecycle methods but it didnt work?

  • Len512 Avatar

    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 null

    is really confusing

  • FArekkusu Avatar

    It's not mentioned anywhere that the initial color should be null.

  • FArekkusu Avatar
    const wrapper = mount(<Counter/>);
    expect(wrapper.children().props().style.borderTop).toEqual('10px solid pink');
    

    The default color is null, why on earth is the expected color right after object creation "pink"?

  • FArekkusu Avatar

    No sample tests.