From 3468c38faf52209b3e68b6432bedd14e3b09fb33 Mon Sep 17 00:00:00 2001 From: kbeyro <121854496+kbeyro@users.noreply.github.com> Date: Fri, 13 Jun 2025 14:24:22 +0200 Subject: [PATCH] fix test --- .../clusters/add-cluster/add-cluster.component.ts | 10 ++++++---- .../users/privileges/userprivileges.component.spec.ts | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts b/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts index 84444672..4e378297 100644 --- a/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts +++ b/src/app/shared/admin/clusters/add-cluster/add-cluster.component.ts @@ -163,10 +163,12 @@ export class AddClusterComponent implements OnInit { } public setInitialValues() { - this.cluster.ingress.controllerConfigOption = IngressControllerConfigOption.USE_EXISTING; - this.cluster.ingress.controllerChartName = ""; - this.cluster.ingress.controllerChartArchive = ""; - this.cluster.ingress.resourceConfigOption = IngressResourceConfigOption.DEPLOY_FROM_CHART; + if (this.cluster.ingress !== undefined) { + this.cluster.ingress.controllerConfigOption = IngressControllerConfigOption.USE_EXISTING; + this.cluster.ingress.controllerChartName = ""; + this.cluster.ingress.controllerChartArchive = ""; + this.cluster.ingress.resourceConfigOption = IngressResourceConfigOption.DEPLOY_FROM_CHART; + } } diff --git a/src/app/shared/users/privileges/userprivileges.component.spec.ts b/src/app/shared/users/privileges/userprivileges.component.spec.ts index 52c435ec..21cc3d33 100644 --- a/src/app/shared/users/privileges/userprivileges.component.spec.ts +++ b/src/app/shared/users/privileges/userprivileges.component.spec.ts @@ -18,9 +18,9 @@ describe('UserPrivilegesComponent', () => { const authServiceSpy = createSpyObj('AuthService', ['hasRole']); authServiceSpy.hasRole.and.returnValue(true) - const domainServiceSpy = createSpyObj('DomainService', ['getGlobalDomainId', 'getAll', 'getMyDomains']) + const domainServiceSpy = createSpyObj('DomainService', ['getGlobalDomainId', 'getAllBase', 'getMyDomains']) domainServiceSpy.getGlobalDomainId.and.returnValue(1) - domainServiceSpy.getAll.and.returnValue(of([])) + domainServiceSpy.getAllBase.and.returnValue(of([])) domainServiceSpy.getMyDomains.and.returnValue(of([])) TestBed.configureTestingModule({ -- GitLab