/*
 * 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 { MatIconModule } from '@angular/material/icon';
import { MatTableModule } from '@angular/material/table';
import { MatTabsModule } from '@angular/material/tabs';
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 { MdNestedTabsDetailsDemoComponent } from './md-nested-tabs-details-demo.component';

const masterDetailViewStub: Partial<MasterDetailViewComponent> = {
  // eslint-disable-next-line no-empty-function
  openDetails() {},
};

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

  beforeEach(
    waitForAsync(() => {
      TestBed.configureTestingModule({
        imports: [
          BciSharedModule,
          RouterTestingModule,
          MatIconModule,
          MatTableModule,
          MatTabsModule,
          NoopAnimationsModule,
        ],
        declarations: [MdNestedTabsDetailsDemoComponent],
        providers: [
          { provide: MasterDetailViewComponent, useValue: masterDetailViewStub },
          { provide: BreadcrumbsService, useValue: { breadcrumbs: of([]) } },
          {
            provide: ActivatedRoute,
            useValue: {
              params: of({ id: 1 }),
            },
          },
        ],
      }).compileComponents();
    })
  );

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

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