1
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>

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

this.form.get('IdGroup').get('Nbrs').setValue([123,2456]);

 component.Enabled.subscribe((value) => {
        fixture.detectChanges();
        expect(value).toBeTruthy();
      });
4

0 回答 0