Semantic-ui-react: Testing with Semantic UI Components

Created on 27 Dec 2016  路  2Comments  路  Source: Semantic-Org/Semantic-UI-React

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?

question

Most helpful comment

Also, this project contains ~6,500 tests. You can reference /test/specs for testing examples.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ctesias picture Ctesias  路  3Comments

keeslinp picture keeslinp  路  3Comments

SajagTiwari picture SajagTiwari  路  3Comments

saikrishnadeep picture saikrishnadeep  路  3Comments

laukaichung picture laukaichung  路  3Comments