okonet/react-scroll-sync

Unit test component containing ScrollSyncPane without associated context

julietkb opened this issue · 3 comments

Pretty much the title. I have a component which does not have its own related context, and so unit testing is difficult since this.context.registerPane and this.context.unregisterPane aren't being mocked. Do I have to create a context for my component just to get the unit tests to work, or does react-scroll-sync have a way to handle this?

You’d have to mock it, yes.

Can you provide an example? Thanks.

Sorry but no, you’d have to do the research yourself.