0

We're moving away from Enzyme and onto react-testing-library. In one of our components, we're using a prop to decide a paddingTop value. That gets passed down the component chain which eventually gets included in a mergeStyleSets() call from @fluentui/merge-styles. That then does NOT output any inline style on the final DOM element, but generates a class name on it instead.

The problem is that regardless of the prop value passed, mergeStyleSets always generates the same class name. This makes perfect sense, however we're a bit stumped on how to test that it's doing what we expect. With Enzyme, the snapshot would contain the react component names + props, so we could see the difference.

Any suggestions on how to test this?

benjamin.keen
  • 1,936
  • 1
  • 20
  • 29

0 Answers0