|
|
|
|
|
by eyelidlessness
2016 days ago
|
|
The usefulness of testing a pure functional stateless component depends on the complexity of what the component does based on its props. And in some cases the testing is valuable but can be abstracted, e.g. with snapshot regression testing. Just as you probably don’t get much value out of testing a function that increments an input number, but you may get a lot of value out of testing, say, a function that generates a series of smooth quadratic curves over a series of points. And that’s a much easier thing to test at the unit level than integration. It seems to me that either: - your usage of props and rendering isn’t particularly complex, but your interaction model is - you’re using state to manage that complexity where someone else may model it without state I’m not passing judgment if it’s the latter, it’s fairly common in the frontend world to model that way. But it’s certainly not my preference. |
|