chai-enzyme

Invoke a function with enzyme when function is passed down as prop - React

[亡魂溺海] 提交于 2019-12-24 03:17:07
问题 I have a function say onClickOfCreateAccountButton which is being called from my Child Component on click of a button but the logic is written in the Parent Component. How do I simulate it? My code: onClickOfCreateAccountButton() { const el = document.getElementsByClassName('SignInSlider-loginSlider')[0]; const el1 = document.getElementsByClassName('SignInSlider-createAccountSlider')[0]; el.classList.add('SignInSlider-animate-show'); el.classList.remove('SignInSlider-animate-hide');