草庐IT

padElement

全部标签

javascript - Jasmine 不能监视事件处理程序?

尝试使用Jasmine测试事件处理程序是否在单击的元素上被调用。有一个包含DOM元素“PadElement”的“Pad”对象,它会被点击。事件处理程序是Pad对象上的一个方法:GRAPH.Pad=function(graphDiv,graph){this.graph=graph;this.clickHandler=function(e){console.log('padElementclickHandlercalled');//this.graph.createVertex(e.clientX,e.clientY);};this.padElement=GRAPH.padElement(