lundi 26 août 2019

How to jest test paneDidMount?

I'm having a problem on how to jest test my codes, I cannot see any related questions on this. please help.

I already tried everything I can, but always fail.

Here's my code:

paneDidMount = (node) => {

if (node) {
  node.addEventListener('scroll', (event) => {
    this.setState({ isScrolled: event.target.scrollTop > 8 });
  });
}

};

I expect the output of passed.

Aucun commentaire:

Enregistrer un commentaire