reactjs - Testing tooltip of char.js component React.js with Enzime -


i have react components <lines /> , inside of have <line /> component react-chartjs-2

the line component has option custom tooltip , there call function actions want this.setcustomtoooltip

i'm trying testing tooltip how this?, don't know how simulate tooltip, tooltip appears in hover event of graphic lines. idea one.

just have code , using chai , enzyme

it('should execute tooltip', () => {     let setcustomtooltipspy = sinon.spy(lines.prototype, 'setcustomtootip');     const wrapper = shallow(<lines />, { lifecycleexperimental: true });     expect(setcustomtooltipspy.calledonce).to.equal(true);     setcustomtooltipspy.restore(); }); 

enter image description here


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -