Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
samteb committed Feb 13, 2024
1 parent 95b6fbc commit 15927ff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/authz/src/shared/__test__/unit/opa.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ describe('reasonToString', () => {
const item = {
id: '12345',
then: Then.PERMIT,
name: 'policyId',
name: 'policyName',
when: []
}
expect(reasonToString(item)).toBe(
'reason = {"type":"permit","policyId":"policyId","approvalsSatisfied":approvals.approvalsSatisfied,"approvalsMissing":approvals.approvalsMissing}'
expect(reasonToString(item)).toEqual(
'reason = {"type":"permit","policyId":"12345","policyName":"policyName","approvalsSatisfied":approvals.approvalsSatisfied,"approvalsMissing":approvals.approvalsMissing}'
)
})

it('returns reason for FORBID rules', () => {
const item = {
id: '12345',
then: Then.FORBID,
name: 'policyId',
name: 'policyName',
when: []
}
expect(reasonToString(item)).toBe(
'reason = {"type":"forbid","policyId":"policyId","approvalsSatisfied":[],"approvalsMissing":[]}'
expect(reasonToString(item)).toEqual(
'reason = {"type":"forbid","policyId":"12345","policyName":"policyName","approvalsSatisfied":[],"approvalsMissing":[]}'
)
})
})

0 comments on commit 15927ff

Please sign in to comment.