From d95fb31627a0818d6724fa69f01c32ab89e87e7f Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Fri, 24 Nov 2023 13:03:57 +0530 Subject: [PATCH] [ACS-6211] Fixed unit tests --- .../actions/rule-action.ui-component.spec.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/projects/aca-content/folder-rules/src/rule-details/actions/rule-action.ui-component.spec.ts b/projects/aca-content/folder-rules/src/rule-details/actions/rule-action.ui-component.spec.ts index 9aed9534df..23d6292822 100644 --- a/projects/aca-content/folder-rules/src/rule-details/actions/rule-action.ui-component.spec.ts +++ b/projects/aca-content/folder-rules/src/rule-details/actions/rule-action.ui-component.spec.ts @@ -74,11 +74,10 @@ describe('RuleActionUiComponent', () => { component.parameterConstraints = dummyConstraints; fixture.detectChanges(); - const cardView = getPropertiesCardView(); - expect(cardView.properties.length).toBe(0); - changeMatSelectValue('mock-action-1-definition'); + const cardView = getPropertiesCardView(); + expect(cardView.properties.length).toBe(5); expect(cardView.properties[0]).toBeInstanceOf(CardViewTextItemModel); expect(cardView.properties[1]).toBeInstanceOf(CardViewBoolItemModel); @@ -87,7 +86,7 @@ describe('RuleActionUiComponent', () => { expect(cardView.properties[4]).toBeInstanceOf(CardViewSelectItemModel); changeMatSelectValue('mock-action-2-definition'); - expect(cardView.properties.length).toBe(0); + expect(getPropertiesCardView()).toBeNull(); }); it('should create category-value action parameter as a text box rather than node picker', () => { @@ -95,11 +94,11 @@ describe('RuleActionUiComponent', () => { component.parameterConstraints = dummyConstraints; fixture.detectChanges(); - const cardView = getPropertiesCardView(); - expect(cardView.properties.length).toBe(0); - changeMatSelectValue('mock-action-3-definition'); + const cardView = getPropertiesCardView(); + + expect(cardView.properties.length).toBe(1); expect(cardView.properties[0].icon).toBeFalsy(); expect(cardView.properties[0].value).toBeFalsy(); expect(cardView.properties[0]).toBeInstanceOf(CardViewTextItemModel);