I need help creating a Jasmine test spec for the following method in my component.
Here is my Component Method
methodName(event): void {
event.preventDefault();
event.target.click();
}
I have started writing a test but don't fully cover event.target.click. Any suggestions on what I should add?
it('should prevent default', () => {
const event = jasmine.createSpyObj('event', ['preventDefault']);
component.methodName(event);
expect(event.preventDefault).toHaveBeenCalled();
});
Appreciate any guidance, thank you!