【发布时间】:2018-10-31 23:06:47
【问题描述】:
有人可以就这个问题给出一些提示吗? 我使用 Component1 中的函数 save() 在 db 中保存患者姓名。
<form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
<input #inputValid type="text" class="form-control" name="nombre" id="field_nombre"
[(ngModel)]="paciente.nombre" required/>
<div class="table-responsive" *ngIf="pacientes">
<tr *ngFor="let paciente of pacientes ;trackBy: trackId">
<td>{{paciente.nombre}}</td>
....
我想使用 Jasmine 对前端部分进行单元测试,我之前保存的这些数据会出现在我的表中。我怎样才能做到这一点?到目前为止,我可以使用 ViewChild 来获取输入和表格的引用,但我需要一个关于如何实际测试它的提示。关于测试的角度教程不包括这样的示例。 谢谢,
【问题讨论】:
-
@trichetriche 你能给我一个提示吗?
标签: javascript html angular unit-testing