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

import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatSnackBar } from '@angular/material/snack-bar';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { ActivatedRoute } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
import { BciSharedModule, BreadcrumbsService, MasterDetailViewComponent } from '@bci-web-core/core';
import { of } from 'rxjs';
import { UserService } from '../../../shared/user-service.service';
import { MdDetailsComponent } from './md-details.component';

const masterDetailViewStub: Partial<MasterDetailViewComponent> = {};

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

  beforeEach(
    waitForAsync(() => {
      TestBed.configureTestingModule({
        imports: [
          BciSharedModule,
          RouterTestingModule,
          ReactiveFormsModule,
          MatFormFieldModule,
          MatInputModule,
          MatIconModule,
          NoopAnimationsModule,
        ],
        declarations: [MdDetailsComponent],
        providers: [
          { provide: MasterDetailViewComponent, useValue: masterDetailViewStub },
          UserService,
          { provide: BreadcrumbsService, useValue: { breadcrumbs: of([]) } },
          {
            provide: ActivatedRoute,
            useValue: {
              params: of({ id: 1 }),
            },
          },
          { provide: MatSnackBar, useValue: {} },
        ],
      }).compileComponents();
    })
  );

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

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