I have a DialogComponent that has the following constructor where Dialog is a custom object:
constructor(
public dialogRef: MatDialogRef
Import MatDialogModule and MatDialogRef from angular/material/dialog instead of angular/material. Import the ModalDialogModule and provide providers for MatDialogRef in your TestBed.
Import {MatdialogModule,MatDialogRef} from '@angular/material/dialog';
TestBed.configureTestingModule({
declarations: [componentName],
imports: [MatdialogModule],
providers: [{provide : MatDialogRef, useValue : {}}]
});