如何测试此功能?
public openOverlayScope(data: any){
return () => {
this._billerService.dataBiller = data;
this._openOverlayToken();
this._dialogRef.close();
}
}
我需要创建此函数以在以下函数中将其作为参数发送,并且使代码的测试更加容易
public openOverlayActiveService(data: Biller) {
this._dialogRef = this._dialog.open(
{
closeLabel: 'Cerrar',
title: 'Alta de servicio',
enableHr: false,
disabledButton: true,
buttons: [
{
label: 'Confirmar',
class: 'strech',
action: scope => { // replace with openOverlayScope()
this._billerService.dataBiller = data;
this._openOverlayToken();
this._dialogRef.close();
}
}
]
},
new CustomDialog(ActivateServiceComponent, { data })
);
}