The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

React Testing: Conditional className with Shallow Rendering

React Testing: Conditional className with Shallow Rendering

2:16
Often our components have output that shows differently depending on the props it is given; in this lesson, we go over how to compare the `className` prop element tree output based on conditional input.
Watch this lesson now
Avatar
egghead.io

Often our components have output that shows differently depending on the props it is given; in this lesson, we go over how to compare the className prop element tree output based on conditional input.

Avatar
Zachary Klein

I don't want to be judgy, but this doesn't strike me as a very illuminating example. I was hoping there might be some support for variable conditions in tests (so the same test could be run with different inputs/expected output). Of course it's no fault of the lesson that this (apparently) isn't possible, but I'm not sure what I learned from this video. :(

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?