import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ToastrModule } from 'ngx-toastr';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { FormsModule } from '@angular/forms'; 
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 
import { ConvertImageComponent } from './convert-image.component';
import { ConfigService } from '@services/config.service';

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

  beforeEach(async () => {
    const mockConfigService = {
      apiUrl: 'http://mock-api-url',
      mercureUrl: 'http://mock-mercure-url'
    };

    await TestBed.configureTestingModule({
      declarations: [ConvertImageComponent],
      imports: [
        HttpClientTestingModule,
        MatDialogModule,
        ToastrModule.forRoot(),
        MatFormFieldModule,
        MatInputModule,
        FormsModule,
        BrowserAnimationsModule 
      ],
      providers: [
        { provide: MatDialogRef, useValue: {} },
        { provide: MAT_DIALOG_DATA, useValue: {} },
        { provide: ConfigService, useValue: mockConfigService }
      ]
    })
    .compileComponents();

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

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