55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
|
|
import { RenameImageComponent } from './rename-image.component';
|
|
import {ConvertImageToVirtualComponent} from "../convert-image-to-virtual/convert-image-to-virtual.component";
|
|
import {MAT_DIALOG_DATA, MatDialogModule, MatDialogRef} from "@angular/material/dialog";
|
|
import {ToastrModule} from "ngx-toastr";
|
|
import {provideHttpClient} from "@angular/common/http";
|
|
import {provideHttpClientTesting} from "@angular/common/http/testing";
|
|
import {ConfigService} from "@services/config.service";
|
|
import {NO_ERRORS_SCHEMA} from "@angular/core";
|
|
|
|
describe('RenameImageComponent', () => {
|
|
let component: RenameImageComponent;
|
|
let fixture: ComponentFixture<RenameImageComponent>;
|
|
|
|
beforeEach(async () => {
|
|
const mockConfigService = {
|
|
apiUrl: 'http://mock-api-url'
|
|
};
|
|
await TestBed.configureTestingModule({
|
|
declarations: [RenameImageComponent],
|
|
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(RenameImageComponent);
|
|
component = fixture.componentInstance;
|
|
fixture.detectChanges();
|
|
});
|
|
|
|
it('should create', () => {
|
|
expect(component).toBeTruthy();
|
|
});
|
|
});
|