diff --git a/ogWebconsole/src/app/components/groups/shared/change-parent/change-parent.component.spec.ts b/ogWebconsole/src/app/components/groups/shared/change-parent/change-parent.component.spec.ts index 70d5bb2..a1f0a43 100644 --- a/ogWebconsole/src/app/components/groups/shared/change-parent/change-parent.component.spec.ts +++ b/ogWebconsole/src/app/components/groups/shared/change-parent/change-parent.component.spec.ts @@ -1,16 +1,53 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ChangeParentComponent } from './change-parent.component'; +import {ManageClientComponent} from "../clients/manage-client/manage-client.component"; +import {HttpClientTestingModule} from "@angular/common/http/testing"; +import {FormsModule, ReactiveFormsModule} from "@angular/forms"; +import {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from "@angular/material/dialog"; +import {MatSnackBarModule} from "@angular/material/snack-bar"; +import {ToastrModule} from "ngx-toastr"; +import {TranslateModule} from "@ngx-translate/core"; +import {MatProgressSpinnerModule} from "@angular/material/progress-spinner"; +import {ConfigService} from "@services/config.service"; +import {DataService} from "../../services/data.service"; +import {MatFormFieldModule} from "@angular/material/form-field"; +import {MatSelectModule} from "@angular/material/select"; +import {NoopAnimationsModule} from "@angular/platform-browser/animations"; describe('ChangeParentComponent', () => { let component: ChangeParentComponent; let fixture: ComponentFixture; beforeEach(async () => { + const mockConfigService = { + apiUrl: 'http://mock-api-url', + mercureUrl: 'http://mock-mercure-url' + }; + await TestBed.configureTestingModule({ - declarations: [ChangeParentComponent] + declarations: [ChangeParentComponent], + imports: [ + HttpClientTestingModule, + ReactiveFormsModule, + MatDialogModule, + MatFormFieldModule, + MatSnackBarModule, + FormsModule , + MatSelectModule , + ToastrModule.forRoot(), + TranslateModule.forRoot(), + NoopAnimationsModule, + MatProgressSpinnerModule + ], + providers: [ + { provide: MatDialogRef, useValue: {} }, + { provide: MAT_DIALOG_DATA, useValue: { data: { id: 123 } } }, + { provide: ConfigService, useValue: mockConfigService }, + DataService + ] }) - .compileComponents(); + .compileComponents(); fixture = TestBed.createComponent(ChangeParentComponent); component = fixture.componentInstance;