Reputation: 757
I have ViewChild
with set content
.
I would like to know how you can test this piece of code using Unit test.
This image is code coverage
@ViewChild(MatSort) set content(content: ElementRef) {
this.sort = content;
Iif (this.sort) {
this.historyReport.sort = this.sort;
}
}
Upvotes: 3
Views: 1751
Reputation: 26
add MatSortModule in the dependency, will help you
imports: [MatSortModule],
declarations: [],
providers: [
]
}).compileComponents();```
Upvotes: 1