/*
 * 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 { NoopAnimationsModule } from '@angular/platform-browser/animations';

import { PinboardModule, Widget, WidgetDefinition } from '@bci-web-core/pinboard';
import { ContentPlaceholderComponent } from '../content-placeholder/content-placeholder.component';

import { ChartjsContentComponent } from './chartjs-content.component';

describe('ChartjsContentComponent', () => {
  let component: ChartjsContentComponent;
  let fixture: ComponentFixture<ChartjsContentComponent>;
  let def: WidgetDefinition<ChartjsContentComponent, any, any>;
  let widget: Widget;

  beforeEach(
    waitForAsync(() => {
      TestBed.configureTestingModule({
        imports: [NoopAnimationsModule, PinboardModule],
        declarations: [ChartjsContentComponent, ContentPlaceholderComponent],
      }).compileComponents();
    })
  );

  beforeEach(() => {
    def = new WidgetDefinition<ChartjsContentComponent, any, any>(
      'mockDef',
      {
        title: 'title',
        id: '1',
        description: 'dd',
        icon: '',
        categoryIds: null,
        visible: true,
      },
      'ChartjsWidget'
    );
    widget = new Widget('mock');
    widget.widgetDefinition = def;

    fixture = TestBed.createComponent(ChartjsContentComponent);
    component = fixture.componentInstance;
    component.widget = widget;
    fixture.detectChanges();
  });

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