How to write jasmine test case for Async Pipe

383 Views Asked by At
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>

How can i write Jasmine Unit test cases for async pipe(Enabled)? I have tried the follwing way

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

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

There are 0 best solutions below