#Getting button from template in a jest test

1 messages · Page 1 of 1 (latest)

limpid meadow
#

So I'm trying to get a button in my template :

<kendo-grid [kendoGridBinding]="customers" [sortable]="true" [autoSize]="true">

  <kendo-grid-column field="isMaster" title="Master" [sortable]="false" [width]="92">
    <ng-template kendoGridCellTemplate let-dataItem>
      <input type="radio" [value]="dataItem">
    </ng-template>
  </kendo-grid-column>
  <kendo-grid-column field="customerId" title="CDB ID" [width]="150"></kendo-grid-column>
  <kendo-grid-column field="name" title="Customer Name" [width]="949"></kendo-grid-column>
  <kendo-grid-column [sortable]="false" [width]="48">
    <ng-template kendoGridCellTemplate let-dataItem>
      <button>
        <i class="icon-wrapper mdi mdi-delete"></i>
      </button>
    </ng-template>
  </kendo-grid-column>
  <ng-template kendoGridToolbarTemplate position="bottom">
    <button rtButton [isActive]="false" class="toolbar-button">
      <i class="icon-wrapper mdi mdi-plus-circle"></i>
      Add a CDB ID
    </button>
  </ng-template>
</kendo-grid>

And when I query my button customerListDe = fixture.debugElement.query(By.css('toolbar-button')); customerListDe is null, any ideas ? 🙂

#

Well problem was with kendo grid not working for angular 13 tests