2

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

enter image description here

  @ViewChild(MatSort) set content(content: ElementRef) {
    this.sort = content;
    Iif (this.sort) {
      this.historyReport.sort = this.sort;
    }
  }
Eliemerson Fonseca
  • 717
  • 3
  • 10
  • 33

1 Answers1

1

add MatSortModule in the dependency, will help you

      imports: [MatSortModule],
      declarations: [],
      providers: [
      ]
    }).compileComponents();```