📜  垫分隔器上的错误 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:27.282000             🧑  作者: Mango

代码示例1
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material";
import { FvCreationPopupComponent } from "./fv-creation-popup.component";

describe("FvCreationPopupComponent", () => {
    let component: FvCreationPopupComponent;
    let fixture: ComponentFixture;
    // const mock: MatDialogRef = new MatDialogRef(null, null) ;

    beforeEach(async(() => {
        // const data: MyDialogComponent = null;
        // data.message = "Dialog Message";
        // tslint:disable-next-line:typedef
        const mockDialogRef = {
            close: jasmine.createSpy("close"),
        };

        TestBed.configureTestingModule({
        imports: [MatDialogModule, MatDividerModule, ...],
        declarations: [ FvCreationPopupComponent ],
        providers: [{ provide: MatDialogRef, useValue: {mockDialogRef} }, { provide: MAT_DIALOG_DATA, useValue: {} } ]})
        .compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(FvCreationPopupComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    it("should create", () => {
        expect(component).toBeTruthy();
    });

});