Warning, /firebird/firebird-ng/src/app/components/io-options/io-options.component.test.ts is written in an unsupported language. File is not indexed.
0001 import { ComponentFixture, TestBed } from '@angular/core/testing';
0002
0003 import { IoOptionsComponent } from './io-options.component';
0004 import { MatDialog } from '@angular/material/dialog';
0005 import { PhoenixUIModule } from '../../phoenix-ui.module';
0006 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
0007
0008 describe('IoOptionsComponent', () => {
0009 let component: IoOptionsComponent;
0010 let fixture: ComponentFixture<IoOptionsComponent>;
0011
0012 const dialog = {
0013 open: jest.fn().mockImplementation(() => {
0014 return {
0015 componentInstance: {
0016 eventDataImportOptions: [],
0017 },
0018 };
0019 }),
0020 };
0021
0022 beforeEach(() => {
0023 TestBed.configureTestingModule({
0024 imports: [BrowserAnimationsModule, PhoenixUIModule],
0025 providers: [
0026 {
0027 provide: MatDialog,
0028 useValue: dialog,
0029 },
0030 ],
0031 declarations: [IoOptionsComponent],
0032 }).compileComponents();
0033 });
0034
0035 beforeEach(() => {
0036 fixture = TestBed.createComponent(IoOptionsComponent);
0037 component = fixture.componentInstance;
0038 fixture.detectChanges();
0039 });
0040
0041 it('should create', () => {
0042 expect(component).toBeTruthy();
0043 });
0044
0045 it('should open IO dialog', () => {
0046 jest.spyOn(dialog, 'open');
0047
0048 component.openIODialog();
0049
0050 expect(dialog.open).toHaveBeenCalled();
0051 });
0052 });