jeudi 18 janvier 2018

Test case in case of check event angular2

Have a click event on check input,

<input class="check-input" (click)="onCheck($event, obj)">

onCheck(event: ElementRef, checkObj){

}

How to write test for this function,

let ele : HTMLElement;
ele = fixture.nativeElement.querySelectorAll('.check-input');
ele.click(new Event('checked'),mockingData);

It gives me "Supplier parameters do not match any signature of call target". How do I trigger click event on this?

Aucun commentaire:

Enregistrer un commentaire