Skip to content

Commit

Permalink
feature(policy): #832 fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-mmaul committed Jun 17, 2024
1 parent a9032bf commit 9c67ed8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
31 changes: 31 additions & 0 deletions frontend/src/app/mocks/services/policy-mock/policy.model.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { getOperatorTypeSign, OperatorType } from '@page/policies/model/policy.model';

fdescribe('getOperatorTypeSign', () => {
it('should return "=" for OperatorType.EQ', () => {
expect(getOperatorTypeSign(OperatorType.EQ)).toBe('=');
});

it('should return "!=" for OperatorType.NEQ', () => {
expect(getOperatorTypeSign(OperatorType.NEQ)).toBe('!=');
});

it('should return "<" for OperatorType.LT', () => {
expect(getOperatorTypeSign(OperatorType.LT)).toBe('<');
});

it('should return ">" for OperatorType.GT', () => {
expect(getOperatorTypeSign(OperatorType.GT)).toBe('>');
});

it('should return "<=" for OperatorType.LTEQ', () => {
expect(getOperatorTypeSign(OperatorType.LTEQ)).toBe('<=');
});

it('should return ">=" for OperatorType.GTEQ', () => {
expect(getOperatorTypeSign(OperatorType.GTEQ)).toBe('>=');
});

it('should return the string representation of the type for unknown types', () => {
expect(getOperatorTypeSign('UNKNOWN' as OperatorType)).toBe('UNKNOWN');
});
});
4 changes: 0 additions & 4 deletions frontend/src/app/modules/page/policies/model/policy.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,3 @@ export enum ConstraintLogicType {
XONE = 'XONE',
ANDSEQUENCE = 'ANDSEQUENCE'
}

export function getPolicyFromEntryList(policyEntryList: PolicyEntry[]): Policy[] {
return policyEntryList.map(entry => entry.payload.policy);
}

0 comments on commit 9c67ed8

Please sign in to comment.