Fixed tests
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
parent
9ef61500cb
commit
4d32540784
|
@ -14,7 +14,8 @@ import { MatRadioModule } from '@angular/material/radio';
|
|||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ToastrModule, ToastrService } from 'ngx-toastr';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { ActivatedRoute, provideRouter } from '@angular/router';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatExpansionModule } from "@angular/material/expansion";
|
||||
import { LoadingComponent } from "../../../../../shared/loading/loading.component";
|
||||
|
@ -63,13 +64,25 @@ describe('DeployImageComponent', () => {
|
|||
provide: MAT_DIALOG_DATA,
|
||||
useValue: {}
|
||||
},
|
||||
{
|
||||
provide: ActivatedRoute,
|
||||
useValue: {
|
||||
queryParams: {
|
||||
subscribe: (fn: (value: any) => void) => fn({ clientData: JSON.stringify([{ '@id': '123', uuid: 'client-uuid', status: 'og-live', partitions: [] }]) })
|
||||
}
|
||||
}
|
||||
},
|
||||
{ provide: ConfigService, useValue: mockConfigService }
|
||||
]
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(DeployImageComponent);
|
||||
component = fixture.componentInstance;
|
||||
component.clientData = [{ '@id': '123', uuid: 'client-uuid', status: 'og-live', partitions: [] }];
|
||||
component.selectedModelClient = component.clientData[0];
|
||||
component.loadPartitions(component.selectedModelClient);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ export class DeployImageComponent {
|
|||
this.http.get(`${this.baseUrl}${client.uuid}`).subscribe(
|
||||
(fullClientData: any) => {
|
||||
this.filteredPartitions = fullClientData.partitions;
|
||||
this.selectedRepository = fullClientData.repository
|
||||
this.selectedRepository = fullClientData.repository ?? null;
|
||||
|
||||
if (fullClientData.partitions) {
|
||||
this.filteredPartitions = fullClientData.partitions.filter((partition: any) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RunScriptAssistantComponent } from './run-script-assistant.component';
|
||||
import { DeployImageComponent } from "../deploy-image/deploy-image.component";
|
||||
import { LoadingComponent } from "../../../../../shared/loading/loading.component";
|
||||
|
@ -21,6 +20,15 @@ import {provideHttpClient} from "@angular/common/http";
|
|||
import { provideHttpClientTesting } from "@angular/common/http/testing";
|
||||
import { provideRouter } from "@angular/router";
|
||||
import { ConfigService } from "@services/config.service";
|
||||
import { TranslateLoader } from '@ngx-translate/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
|
||||
export function HttpLoaderFactory(http: HttpClient) {
|
||||
return new TranslateHttpLoader(http);
|
||||
}
|
||||
|
||||
describe('RunScriptAssistantComponent', () => {
|
||||
let component: RunScriptAssistantComponent;
|
||||
|
@ -33,7 +41,7 @@ describe('RunScriptAssistantComponent', () => {
|
|||
};
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [DeployImageComponent, LoadingComponent],
|
||||
declarations: [RunScriptAssistantComponent, DeployImageComponent, LoadingComponent],
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
FormsModule,
|
||||
|
@ -46,10 +54,18 @@ describe('RunScriptAssistantComponent', () => {
|
|||
MatTableModule,
|
||||
MatDividerModule,
|
||||
MatRadioModule,
|
||||
MatProgressSpinnerModule,
|
||||
MatSelectModule,
|
||||
BrowserAnimationsModule,
|
||||
ToastrModule.forRoot(),
|
||||
TranslateModule.forRoot()
|
||||
HttpClientTestingModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: HttpLoaderFactory,
|
||||
deps: [HttpClient]
|
||||
}
|
||||
})
|
||||
],
|
||||
providers: [
|
||||
FormBuilder,
|
||||
|
|
Loading…
Reference in New Issue