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

import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { MatIconModule } from '@angular/material/icon';
import { BCI_SHARED_INTL_PROVIDER } from '../shared-intl';
import { BciFilterComponent } from './bci-filter.component';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';

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

  const fb = new FormBuilder();

  const formGroup: FormGroup = fb.group({
    ticketFilter: fb.group({
      creatorDetails: fb.group({
        username: fb.group({
          label:'Username',
          value: ['', Validators.minLength(3)],
          active: false
        }),
        userRole: fb.group({
          label:'Role',
          value: [''],
          active: false
        }),
        unit: fb.group({
          label:'Department unit',
          value: [''],            
          active: false,
        })
      }),
      ticketProgress: fb.group({
        progress: fb.group({
          label:'Tickets InProgress',
          value: [0],
          active: false
        })
      }),
      ticketStatus: fb.group({
        status: fb.group({
          label:'Status',
          value: [''],            
          active: false,
        })
      }),
    }),
  });

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

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

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