/**
 * Copyright (C) 2022 Robert Bosch GmbH Copyright (C) 2022 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { MatIconModule } from '@angular/material/icon';
import { RouterTestingModule } from '@angular/router/testing';

import { BciLinkComponent, LinkOptions } from './bci-link.component';

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

  const linkOptions: LinkOptions = {url: "www.bosch.com", disabled: false, fontsize: 18, iconName: "bosch-ic-emoji-happy", iconPosition: "left", type: "primary"};

  beforeEach(
    waitForAsync(() => {
      TestBed.configureTestingModule({
        imports: [RouterTestingModule,MatIconModule],
        declarations: [BciLinkComponent],
      }).compileComponents();
    })
  );

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

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

  it('should have all input variables', () => {
    expect(component.linkOptions.disabled).toBe(false);
    expect(component.linkOptions.fontsize).toBe(18);
    expect(component.linkOptions.iconName).toBe("bosch-ic-emoji-happy");
    expect(component.linkOptions.iconPosition).toBe("left");
    expect(component.linkOptions.type).toBe("primary");
  });

  it('should create', () => {
    component.linkOptions = {url: "www.bosch.com", disabled: false, fontsize: 24, iconName: "bosch-ic-laser", iconPosition: "left", type: "primary"};
    expect(component.linkOptions.iconName).toBe("bosch-ic-laser");
    expect(component.linkOptions.fontsize).toBe(24);
  });
  
});
