I'm using React Boilerplate with MJ's expect, enzyme and Semantic UI React, and I want to test if some of my components are rendered correctly, including some of the semantic ui components, for example:
Import HomeHeader from '../index';
Import {Header} of 'semantic-ui-react';
Const renderedComponent = shallow (
<HomeHeader />
);
Expect (renderedComponent.find (Header) .length) .toEqual (1);
But apart to all the tests done, unfortunately, I can not set a test correctly where I can find a node Header.
How can I use semantic components as part of my tests?
NVM. I should use mount instead of shallow in order to render children nodes. I'm leaving this here so this can help anyone.
Also, this project contains ~6,500 tests. You can reference /test/specs for testing examples.
Most helpful comment
Also, this project contains ~6,500 tests. You can reference
/test/specsfor testing examples.