#metabrainz

/

      • pristine___
        Mr_Monkey: iconHover is a prop of RecommendationControl.tsx. I want to check if from RecommendationCard.tsx, the component RecommendationControl.tsx is called with correct values.
      • 2020-11-26 33137, 2020

      • pristine___
      • 2020-11-26 33151, 2020

      • pristine___
        something like this maybe
      • 2020-11-26 33152, 2020

      • pristine___
      • 2020-11-26 33118, 2020

      • MRiddickW joined the channel
      • 2020-11-26 33139, 2020

      • Mr_Monkey
        Looks like this line gives us a clue as to how to target the RecommendationControl components:
      • 2020-11-26 33139, 2020

      • Mr_Monkey
        `shallow(<Parent {...props}/>).find(Child);`
      • 2020-11-26 33138, 2020

      • Mr_Monkey
        In our case, i suppose it's going to be something like `wrapper..find(RecommendationControl)` ?
      • 2020-11-26 33138, 2020

      • Mr_Monkey
        I'm not super proficient with enzyme, so I'd suggest having a look at the docs for that.
      • 2020-11-26 33159, 2020

      • Mr_Monkey
        Yeah, options 2 or 3 in these docs could work: https://enzymejs.github.io/enzyme/docs/api/select…
      • 2020-11-26 33147, 2020

      • Mr_Monkey
        It should return an array of `RecommendationControl` components, I'll assume in the order they appear in the page. You can check that you have the length equal to how many components you're expecting, and then target each one by index and check its props
      • 2020-11-26 33127, 2020

      • Mr_Monkey
        `expect(recommendationControlComponents[0].props.iconHover).toEqual(faAngry)` ?
      • 2020-11-26 33138, 2020

      • MRiddickW has left the channel
      • 2020-11-26 33158, 2020

      • Mr_Monkey
        Does that answer your query pristine___ ?
      • 2020-11-26 33143, 2020

      • pristine___
        Mr_Monkey: Yes, thank you :)
      • 2020-11-26 33152, 2020

      • Mr_Monkey
        Cool :)
      • 2020-11-26 33107, 2020

      • Mr_Monkey , signing off.
      • 2020-11-26 33129, 2020

      • MajorLur_ joined the channel
      • 2020-11-26 33129, 2020

      • MajorLur_ is now known as MajorLurker_
      • 2020-11-26 33124, 2020

      • MajorLurker_ has quit
      • 2020-11-26 33134, 2020

      • dseomn_ joined the channel
      • 2020-11-26 33155, 2020

      • dseomn_ has quit
      • 2020-11-26 33153, 2020

      • dseomn_ joined the channel
      • 2020-11-26 33130, 2020

      • dseomn_ has quit
      • 2020-11-26 33145, 2020

      • dseomn_ joined the channel
      • 2020-11-26 33106, 2020

      • dseomn_ has quit
      • 2020-11-26 33100, 2020

      • dseomn_ joined the channel
      • 2020-11-26 33114, 2020

      • dseomn- joined the channel
      • 2020-11-26 33137, 2020

      • dseomn_ has quit
      • 2020-11-26 33155, 2020

      • v6lur joined the channel
      • 2020-11-26 33133, 2020

      • dseomn_ joined the channel
      • 2020-11-26 33138, 2020

      • dseomn- has quit
      • 2020-11-26 33157, 2020

      • d4rkie joined the channel
      • 2020-11-26 33102, 2020

      • Nyanko-sensei has quit
      • 2020-11-26 33105, 2020

      • v6lur has quit
      • 2020-11-26 33152, 2020

      • MajorLur_ joined the channel
      • 2020-11-26 33113, 2020

      • MajorLur_ has quit
      • 2020-11-26 33152, 2020

      • v6lur joined the channel