From f3c4ac5d22b6eba072e6b34049e70a02ba4fae5f Mon Sep 17 00:00:00 2001 From: Stephan Girod Date: Wed, 11 Dec 2024 09:14:28 +0100 Subject: [PATCH] fix: tests --- .../resource-edit-page/resource-edit-page.component.spec.ts | 6 +++--- .../resource-edit-page/resource-edit-page.component.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.spec.ts b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.spec.ts index 15c485dce..12a1c508f 100644 --- a/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.spec.ts +++ b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.spec.ts @@ -12,9 +12,9 @@ describe('ResourceEditComponent', () => { let componentRef: ComponentRef; let fixture: ComponentFixture; - const mockRoute: any = { paramMap: of() }; - mockRoute.paramMap = new Subject(); - mockRoute.paramMap.next({ + const mockRoute: any = { queryParamMap: of() }; + mockRoute.queryParamMap = new Subject>(); + mockRoute.queryParamMap.next({ id: 42, }); diff --git a/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.ts b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.ts index 4affc9d83..cc64f7489 100644 --- a/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.ts +++ b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.ts @@ -27,7 +27,7 @@ export class ResourceEditPageComponent { ); isLoading = computed(() => { - if (this.ids().keys) { + if (this.ids()?.keys) { // TODO show correct STAGE by context id this.resourceService.getResource(Number(this.ids().get('id'))); return false;