Skip to content

Commit

Permalink
test: add tests to meet coverage min
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwelde committed Jul 12, 2019
1 parent a9a3088 commit d82442d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/requestforattestation/RequestForAttestation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,26 @@ describe('RequestForAttestation', () => {
delete request.claimHashTree[propertyName]
expect(request.verifyData()).toBeFalsy()
})

it('hides the claim owner', () => {
const request = buildRequestForAttestation(identityBob, 'ctype', {}, [])
request.removeClaimOwner()
expect(request.claimOwner.nonce).toBeUndefined()
expect(request.claim.owner).toBeUndefined()
})

it('hides claim properties', () => {
const request = buildRequestForAttestation(
identityBob,
'ctype',
{ a: 'a', b: 'b' },
[]
)
request.removeClaimProperties(['a'])

expect((request.claim.contents as any).a).toBeUndefined()
expect((request.claimHashTree as any).a.nonce).toBeUndefined()
expect((request.claim.contents as any).b).toBe('b')
expect((request.claimHashTree as any).b.nonce).toBeDefined()
})
})

0 comments on commit d82442d

Please sign in to comment.