/*
 * Copyright (C) 2019 Robert Bosch GmbH Copyright (C) 2019 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { AlertService, BciComponentModule, ModalWindowService } from '@bci-web-core/core';
import { of } from 'rxjs';
import { ModalWindowDemoFormModalComponent } from './modal-window-demo-form-modal.component';

describe('ModalWindowDemoFormModalComponent', () => {
  let component: ModalWindowDemoFormModalComponent;
  let fixture: ComponentFixture<ModalWindowDemoFormModalComponent>;

  beforeEach(
    waitForAsync(() => {
      TestBed.configureTestingModule({
        imports: [
          NoopAnimationsModule,
          BciComponentModule,
          MatIconModule,
          FormsModule,
          MatInputModule,
          MatFormFieldModule,
        ],
        providers: [
          { provide: MAT_DIALOG_DATA, useValue: {} },
          {
            provide: MatDialogRef,
            useValue: {
              _containerInstance: {
                _config: {},
              },
              // eslint-disable-next-line no-empty-function
              close: () => {},
              backdropClick: () => of(''),
              keydownEvents: () => of(''),
            },
          },
          AlertService,
          ModalWindowService,
        ],
        declarations: [ModalWindowDemoFormModalComponent],
      }).compileComponents();
    })
  );

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

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