From 934740ac0b7b63aa6aa3e1e4e1323d7f08a6b605 Mon Sep 17 00:00:00 2001 From: Vito Albano Date: Tue, 23 Apr 2024 12:59:17 +0100 Subject: [PATCH] Fixed unit test --- .../card-view-textitem.component.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts index 26a6f3d638e..6f6e6b1d1ca 100644 --- a/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts @@ -41,9 +41,7 @@ describe('CardViewTextItemComponent', () => { const expectedErrorMessages = [{ message: 'Something went wrong' } as CardViewItemValidator]; - const getTextField = (key: string): HTMLInputElement => { - return fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${key}"]`)).nativeElement; - }; + const getTextField = (key: string): HTMLInputElement => fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${key}"]`)).nativeElement; const updateTextField = (key: string, value) => { const editInput = getTextField(key); @@ -97,6 +95,7 @@ describe('CardViewTextItemComponent', () => { param3: string ) => { component.property = new CardViewTextItemModel(cardViewTextItemObject); + component.editable = cardViewTextItemObject.editable; component.useChipsForMultiValueProperty = flag; component.ngOnChanges({ property: new SimpleChange(null, null, true) }); @@ -305,6 +304,7 @@ describe('CardViewTextItemComponent', () => { multivalued: true }; + component.editable = true; component.property = new CardViewTextItemModel(cardViewTextItemObject); component.displayLabelForChips = true; component.ngOnChanges({ property: new SimpleChange(null, null, true) }); @@ -327,6 +327,7 @@ describe('CardViewTextItemComponent', () => { multivalued: true }; + component.editable =true; component.property = new CardViewTextItemModel(cardViewTextItemObject); component.displayLabelForChips = false; component.ngOnChanges({ property: new SimpleChange(null, null, true) });