Nso
Nso

Reputation: 11

How can we access to inputs of ng-select for unit test?

My goal is to test if some inputs like for example [isOpen] or [multiple] are equal to true.

I haven't any idea of how to access at this inputs, I tried by the DOM but it doesn't work. Please help me .

<ng-select
        [ngModel]="carsInit"
        (change)="changeCars($event)"
        [items]="cars$ | async"
        [clearable]="false"
        [multiple]="true"
        [placeholder]="placeholderCars$ | async"
        [isOpen]="true"
      ></ng-select>

Upvotes: 1

Views: 1048

Answers (1)

Joep Kockelkorn
Joep Kockelkorn

Reputation: 302

While it may be valuable to test if ng-select works properly I think it should not be the scope of your test. If it were variables in your Component you could test those, but testing the functionality of ng-select is the scope of ng-select.

Upvotes: 2

Related Questions