Answer the question
In order to leave comments, you need to log in
How to test this kind of components?
There is this component:
<div className={cn('list', { active: isOpen })}>
<Visible xs sm md>
<AdditionalComponent />
</Visible>
Hello world!
</div>
global.innerWidth = 500;
global.dispatchEvent(new Event('resize'));
Answer the question
In order to leave comments, you need to log in
These tests are usually Brittle because the jest dom is not the full DOM of the browser, so they need to be approached with extreme care.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question