From 5ca8d722e2bc0f2ad3e4ba49e853a3789ebed7f1 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 524707ec8c..d65abfa62b 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 = getByDataAutomationId('rule-action-card-view').componentInstance as CardViewComponent; - expect(cardView.properties.length).toBe(0); - changeMatSelectValue('rule-action-select', 'mock-action-1-definition'); + const cardView = getByDataAutomationId('rule-action-card-view').componentInstance as CardViewComponent; + 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('rule-action-select', 'mock-action-2-definition'); - expect(cardView.properties.length).toBe(0); + expect(getByDataAutomationId('rule-action-card-view')).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 = getByDataAutomationId('rule-action-card-view').componentInstance as CardViewComponent; - expect(cardView.properties.length).toBe(0); - changeMatSelectValue('rule-action-select', 'mock-action-3-definition'); + const cardView = getByDataAutomationId('rule-action-card-view').componentInstance as CardViewComponent; + + expect(cardView.properties.length).toBe(1); expect(cardView.properties[0].icon).toBeFalsy(); expect(cardView.properties[0].value).toBeFalsy(); expect(cardView.properties[0]).toBeInstanceOf(CardViewTextItemModel);