import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideHttpClient } from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { ConvertImageToVirtualComponent } from './convert-image-to-virtual.component';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ToastrModule } from 'ngx-toastr';
import { ConfigService } from '@services/config.service';

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

  beforeEach(async () => {
    const mockConfigService = {
      apiUrl: 'http://mock-api-url'
    };
    await TestBed.configureTestingModule({
      declarations: [ConvertImageToVirtualComponent],
      imports: [
        MatDialogModule,
        ToastrModule.forRoot()
      ],
      providers: [
        provideHttpClient(),
        provideHttpClientTesting(),
        {
          provide: MatDialogRef,
          useValue: {}
        },
        {
          provide: MAT_DIALOG_DATA,
          useValue: {}
        },
        {
          provide: ConfigService,
          useValue: mockConfigService
        }
      ],
      schemas: [NO_ERRORS_SCHEMA]
    })
      .compileComponents();

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

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