如何为异步管道编写茉莉花测试用例

时间:2018-09-14 05:03:50

标签: angular rxjs karma-jasmine angular2-forms combinelatest

mergDict(firstDict: &firstDictToMerge, secondDict: secondDictToMerge)

如何为异步管道编写Jasmine单元测试用例(已启用)? 我尝试了以下方式

this.Enabled = combineLatest(this.form.get('IdGroup').get('Nbrs').valueChanges.pipe(startWith(null)),
      this.form.get('IdGroup').get('Ids').valueChanges.pipe(startWith(null)),

      (Nbrs, Ids) => {            
        return !((Nbrs instanceof Array && Nbrs.length > 0) || (Ids instanceof Array && Ids.length > 0) );
      });

<div *ngIf="Enabled | async" >
<p> Show Text </p>
</div>

0 个答案:

没有答案