bruderstein / unexpected-react

Plugin for http://unexpected.js.org to enable testing the full React virtual DOM, and also the shallow renderer

Home Page:http://bruderstein.github.io/unexpected-react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make `deeply render as` work with `<></>` at the root

salomvary opened this issue · comments

This test currently fails:

        it('renders a component with a fragment at the root', function () {

            const Fragment = function () {
                return <><div>Yay</div><div>Yeah</div></>;
            };

            expect(<Fragment/>,
                'to deeply render as', <><div>Yay</div><div>Yeah</div></>
            );
        });

with the following error:

  1) unexpected-react (deep rendering) to deeply render as renders a component with a fragment at the root:
     UnexpectedError: 
expected <Fragment />
to deeply render as <no-display-name><div>Yay</div><div>Yeah</div></no-display-name>

<Fragment // should be <no-display-name
>
  <div>Yay</div><div>Yeah</div>
</Fragment>