component.ts file
import { MatDialog } from '@angular/material/dialog';
constructor(private _matDialog: MatDialog) { }
onOpenModal(template) {
this._matDialog.open(template);
}
How to write a test case for the above method, using Angular's ng test
?