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

import { VerticalProfileItemComponent } from './vertical-profile-item.component';
import { UserRepository } from '@app/domain/users/user.repository';
import { provideRouter } from '@angular/router';
import { USER_REPOSITORY_TOKEN } from '@app/infrastructure/users/user-repository.token';
import { User } from '@app/domain/users/user.model';
import { of } from 'rxjs';
import { SECTOR_REPOSITORY_TOKEN } from '@app/infrastructure/sectors/sector-repository.token';
import { SectorRepository } from '@app/domain/sectors/sector.repository';
import { Sector } from '@app/domain/sectors/sector.model';

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

  let mockUserRepo: UserRepository;
  let mockSectorRepo: SectorRepository;

  beforeEach(async () => {
    mockUserRepo = {
      update: jest.fn().mockReturnValue(of({} as User)),
      getUserById: jest.fn().mockReturnValue(of({} as User)),
    };

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

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

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

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