import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ChipsComponent } from './chips.component';
import { provideRouter } from '@angular/router';
import { SECTOR_REPOSITORY_TOKEN } from '@app/infrastructure/sectors/sector-repository.token';
import { of } from 'rxjs';
import { Sector } from '@app/domain/sectors/sector.model';
import { SectorRepository } from '@app/domain/sectors/sector.repository';

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

  let mockSectorRepo: SectorRepository;

  beforeEach(async () => {
    mockSectorRepo = {
      list: jest.fn(),
      getOne: jest.fn().mockReturnValue(of({} as Sector)),
    };

    await TestBed.configureTestingModule({
      imports: [ChipsComponent],
      providers: [
        provideRouter([]),
        { provide: SECTOR_REPOSITORY_TOKEN, useValue: mockSectorRepo },
      ],
    }).compileComponents();

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

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