角度功能线覆盖范围

时间:2020-04-21 06:04:30

标签: angular unit-testing

我一直在尝试在组件内的以下功能的线路覆盖率。规格已设置并准备就绪,但我无法确定测试内容。

    const dialogRef = this.dialog.open(
        StartTaskDialogComponent, {
          data: {
            id: i,
            name
          }
        });

    dialogRef.afterClosed().subscribe(result => {
      console.log('The start task dialog was closed');
      this.getTasks();
      this.getDateTasks();
    });
  }```

The line coverage I need to cover is from dialogRef and forward. I have tried calling dialogRef with the component but it only accepts dialog. 

Any assistance. 

0 个答案:

没有答案