nullinjectorerror no provider for matdialog unit test code example
Example: NullInjectorError: No provider for MatDialogRef!
import {DialogService} from './services/dialog.service';
import {MatDialogModule, MatDialogRef} from '@angular/material/dialog';
...
imports: [
...
MatDialogModule
],
providers: [
{
provide: MatDialogRef,
useValue: {}
},
DialogService
],
...