You should be able to directly trigger the mouseover event, and then check the appropriate behavior:
it("should do something on hover", function() {
$('.class').trigger('mouseover');
expect($('#someid')).toBeHidden();
$('.class').trigger('mouseout');
expect($('#someid')).toBeShown();
});
$('#someid')must be in the DOM. The best way to do this is through adaptation.
source
share