Fixed tests
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
parent
380cf50080
commit
7659c09cd6
|
@ -4,7 +4,6 @@ import { MatInputModule } from '@angular/material/input';
|
|||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatOptionModule } from '@angular/material/core';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
|
|
@ -1,16 +1,65 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HttpClientTestingModule, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { EditImageComponent } from './edit-image.component';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog';
|
||||
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { provideHttpClient } from '@angular/common/http';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
|
||||
describe('EditImageComponent', () => {
|
||||
let component: EditImageComponent;
|
||||
let fixture: ComponentFixture<EditImageComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
const mockConfigService = {
|
||||
apiUrl: 'http://mock-api-url'
|
||||
};
|
||||
|
||||
const mockDialogData = {
|
||||
image: {
|
||||
'@id': 'mock-id',
|
||||
name: 'Mock Image',
|
||||
description: 'Mock Description'
|
||||
}
|
||||
};
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [EditImageComponent]
|
||||
declarations: [EditImageComponent],
|
||||
imports: [
|
||||
HttpClientTestingModule,
|
||||
MatDialogModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
ToastrModule.forRoot(),
|
||||
BrowserAnimationsModule
|
||||
],
|
||||
providers: [
|
||||
FormBuilder,
|
||||
ToastrService,
|
||||
provideHttpClient(),
|
||||
provideHttpClientTesting(),
|
||||
{
|
||||
provide: MatDialogRef,
|
||||
useValue: {}
|
||||
},
|
||||
{
|
||||
provide: MAT_DIALOG_DATA,
|
||||
useValue: mockDialogData
|
||||
},
|
||||
{
|
||||
provide: ConfigService,
|
||||
useValue: mockConfigService
|
||||
}
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EditImageComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@ -20,4 +69,4 @@ describe('EditImageComponent', () => {
|
|||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue