import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { WptDialogRef, WPT_DIALOG_DATA } from '@arrow/warpaint/dialog'; import { AlertComponent } from './alert.component'; function provideDialogData() { return { title: 'some title', buttons: [ { confirm: {} } ] }; } describe('AlertComponent', () => { let component: AlertComponent; let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA], declarations: [AlertComponent], providers: [ { provide: WptDialogRef, useValue: {} }, { provide: WPT_DIALOG_DATA, useFactory: provideDialogData } ] }).compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(AlertComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });