/*
 * 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, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { PinboardConfig, PinboardI18nService } from '@bci-web-core/pinboard';
import { DashboardSettingsComponent } from './dashboard-settings.component';

const DASHBOARDS: PinboardConfig[] = [
  { id: 'foo', label: 'Dashboard 1', priority: 0, settings: [] },
  { id: 'bar', label: 'Dashboard 2', priority: 1, settings: [] },
];

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

  beforeEach(
    waitForAsync(() => {
      TestBed.configureTestingModule({
        imports: [
          BrowserAnimationsModule,
          FormsModule,
          ReactiveFormsModule,
          MatIconModule,
          MatInputModule,
          MatButtonModule,
          MatDialogModule,
        ],
        declarations: [DashboardSettingsComponent],
        providers: [
          PinboardI18nService,
          { provide: MAT_DIALOG_DATA, useValue: { dashboards: DASHBOARDS } },
          { provide: MatDialogRef, useValue: {} },
        ],
      }).compileComponents();
    })
  );

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

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