Hello, I had a question about unit testing with Jasmine (plugin: jQuery)
How can I check if an object is inside a DOM of a document. The fact is that I use the tooltip function, which will be activated only when the event is simulated. When there is a simulation of the effect, the object is attached to the DOM, and I want to check whether it is visible or not.
it("test 1: should invoke the Tooltip() function.", function () {
spyEvent = spyOnEvent('.span_width', "mouseover");
$('.span_width').simulate('mouseover');
expect('mouseover').toHaveBeenTriggeredOn('.span_width');
expect(spyEvent).toHaveBeenTriggered();
});
source
share