So I have a function to remove all tabbing from a particular page. There is a variable declared in this function that does the work. I need to pass dummy value to this variable so that the value will pass and function executes.
How do I write test case using ReactJS TestUtils for the following.
_removeAllTabbing() {
const accordionTitleAnchors = [
document.getElementById('accordion-panel-1').firstChild,
document.getElementById('accordion-panel-2').firstChild,
document.getElementById('accordion-panel-3').firstChild,
document.getElementById('accordion-panel-4').firstChild,
document.getElementById('accordion-panel-5').firstChild
];
_.each(accordionTitleAnchors, accordionTitleAnchor => {
this._removeTabbing(accordionTitleAnchor);
});
}
So far I have this
xit('should call _removeAllTabbing function', () => {
const educate = new EducateAccordion();
const accordionTitleAnchors = TestUtils.scryRenderedDOMComponentsWithClass(this.component, 'panel-title');;
educate._removeAllTabbing(accordionTitleAnchors);
});
Also, it will be great if anyone can share some docs/articles for testing different front end scenarios.