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

import { MyProfileProjectListComponent } from './my-profile-project-list.component';
import { ProjectRepository } from '@app/domain/projects/project.repository';
import { provideRouter } from '@angular/router';
import { PROJECT_REPOSITORY_TOKEN } from '@app/infrastructure/projects/project-repository.token';
import { mockProfileRepo } from '@app/testing/profile.mock';
import { ToastrService } from 'ngx-toastr';
import { mockToastR } from '@app/testing/toastr.mock';

describe('MyProfileProjectListComponent', () => {
  let component: MyProfileProjectListComponent;
  let fixture: ComponentFixture<MyProfileProjectListComponent>;
  let mockProjectRepository: jest.Mocked<Partial<ProjectRepository>> = mockProfileRepo;

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      imports: [MyProfileProjectListComponent],
      providers: [
        provideRouter([]),
        { provide: PROJECT_REPOSITORY_TOKEN, useValue: mockProjectRepository },
        { provide: ToastrService, useValue: mockToastR },
      ],
    }).compileComponents();

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

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