fields-of-arle icon indicating copy to clipboard operation
fields-of-arle copied to clipboard

Tests for components

Open Stefan-Hanke opened this issue 6 years ago • 3 comments

There is logic inside components that I'd like to test, e.g. in #183 Any plans? Enzyme?

Stefan-Hanke avatar Dec 06 '18 01:12 Stefan-Hanke

Jest should work, and feel free to use snapshots of an enzyme shallow render of the component, but if you use enzyme directly like that, add it to the devDependencies

philihp avatar Dec 06 '18 07:12 philihp

I've added Enzyme, its React-16 adapter, and sinon as dev deps (see here)

Please advise, I'll just update to whatever you suggest.

Jest itself does not do any snapshotting? Their guide uses a react test renderer that would have to be installed, too.

Stefan-Hanke avatar Dec 06 '18 16:12 Stefan-Hanke

I guess I had this in mind for snapshots: https://hackernoon.com/testing-react-components-with-jest-and-enzyme-41d592c174f

philihp avatar Dec 12 '18 22:12 philihp