我的<mat-paginator>
元素工作正常,我只想知道如何使用@testing-library/angular 库测试属性的getPaginatorData
方法?(page)
<mat-paginator
#billingItemsPaginator
[pageIndex]="paginatorObject.billingItems.pageIndex"
[pageSize]="paginatorObject.billingItems.pageSize"
[pageSizeOptions]="[6, 12]"
(page)="getPaginatorData($event, 'billingItems')"
showFirstLastButtons="true"
>
</mat-paginator>
这是我的组件
billingItemsSource = new MatTableDataSource<any>();
public billingItemsPaginator: MatPaginator;
@ViewChild('billingItemsPaginator') set matBillingItemsPaginator(
mp: MatPaginator
) {
this.billingItemsPaginator = mp;
this.billingItemsSource.paginator = this.billingItemsPaginator;
}
提前致谢。