import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ManageOrganizationalUnitComponent } from './manage-organizational-unit.component';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ReactiveFormsModule } from '@angular/forms';
import { ToastrModule } from 'ngx-toastr';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateModule } from '@ngx-translate/core';
import { LoadingComponent } from '../../../../../shared/loading/loading.component';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; 
import { ConfigService } from '@services/config.service';

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

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

    await TestBed.configureTestingModule({
      declarations: [ManageOrganizationalUnitComponent, LoadingComponent],
      imports: [
        HttpClientTestingModule,
        ReactiveFormsModule,
        ToastrModule.forRoot(),
        MatFormFieldModule,
        MatInputModule,
        MatSelectModule,
        MatSlideToggleModule,
        MatCheckboxModule,
        TranslateModule.forRoot(),
        BrowserAnimationsModule,
        MatProgressSpinnerModule
      ],
      providers: [
        { provide: MatDialogRef, useValue: {} },
        { provide: MAT_DIALOG_DATA, useValue: {} },
        { provide: ConfigService, useValue: mockConfigService }
      ]
    })
      .compileComponents();

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

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