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(); });
Comments
Post a Comment