Skip to content

Commit

Permalink
[ACS-6211] Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
swapnil-verma-gl committed Dec 5, 2023
1 parent 0994ae7 commit d95fb31
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -87,19 +86,19 @@ 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', () => {
component.actionDefinitions = [actionLinkToCategoryTransformedMock];
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);
Expand Down

0 comments on commit d95fb31

Please sign in to comment.