I want to do unit testing for DOM manipulation. Here is my scenario. I triggered the form reset by triggering the Click action of button using it's ID
document.getElementById('edit-reset').click();
I tried to perform unit testing, this is my try but not sure whether it's correct
var DOM = document.getElementById('edit-reset');
spyOn(document, 'getElementById').and.returnValue(true);
DOM.click();
expect(document.getElementById).toHaveBeenCalledWith('edit-reset');
Using jasmine and karma for UNIT testing Application is built on IONIC - Angular JS.
Help Appreciated ,How we can do unit testing for the above code in angularjs using jasmine?
Thanks!