This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kevin Griffin <[email protected]>
- Loading branch information
Showing
4 changed files
with
86 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,79 @@ | ||
import { describe, expect, it } from '@jest/globals'; | ||
import { credentials } from '../src/credentials'; | ||
|
||
describe('ecr credentials', () => { | ||
it('should create ecr data', () => { | ||
let data = new credentials.LegalEntityCredentialData({ | ||
issuee: 'issuee', | ||
timestamp: 'timestamp', | ||
LEI: 'lei', | ||
import { edges } from '../src/edges'; | ||
import { schema } from '../src/schema'; | ||
|
||
describe('edges', () => { | ||
it('should create legal entity credential edge', () => { | ||
let data = new edges.LegalEntityCredentialEdgeData({ | ||
qviCredentialSAID: 'my qvi credential said', | ||
}); | ||
|
||
let edge = new edges.LegalEntityCredentialEdge({ qvi: data }); | ||
|
||
expect(edge.d).toBe('EErRQydqQppqs8OsX5XPwbXvItMWx3U6jwmqiJR15IXc'); | ||
expect(edge.qvi.n).toBe('my qvi credential said'); | ||
expect(edge.qvi.s).toBe(schema.QVI); | ||
}); | ||
|
||
it('should create engagement context role credential edge', () => { | ||
let data = new edges.EngagementContextRoleCredentialEdgeData({ | ||
engagementContextRoleAuthorizationCredentialSAID: | ||
'my ecr auth credential said', | ||
}); | ||
|
||
let edge = new edges.EngagementContextRoleCredentialEdge({ | ||
auth: data, | ||
}); | ||
|
||
expect(edge.d).toBe('ENmhHNmmrYqAWhisnSyQyQlsUrn5HFpDvUjZ5_ev043_'); | ||
expect(edge.auth.n).toBe('my ecr auth credential said'); | ||
expect(edge.auth.s).toBe(schema.ECRAuth); | ||
}); | ||
|
||
it('should create official organizational role credential edge', () => { | ||
let data = new edges.OfficialOrganizationalRoleCredentialEdgeData({ | ||
officialOrganizationalRoleAuthorizationCredentialSAID: | ||
'my oor auth credential said', | ||
}); | ||
|
||
let edge = new edges.OfficialOrganizationalRoleCredentialEdge({ | ||
auth: data, | ||
}); | ||
|
||
expect(edge.d).toBe('EOshmoza8V7wyEMOC0e4Qh31MP89hAo9GJwyctOTFvgg'); | ||
expect(edge.auth.n).toBe('my oor auth credential said'); | ||
expect(edge.auth.s).toBe(schema.OORAuth); | ||
}); | ||
|
||
it('should create engagement context role authorization credential edge', () => { | ||
let data = | ||
new edges.EngagementContextRoleAuthorizationCredentialEdgeData({ | ||
legalEntityCredentialSAID: 'my ecr auth credential said', | ||
}); | ||
|
||
let edge = new edges.EngagementContextRoleAuthorizationEdge({ | ||
le: data, | ||
}); | ||
|
||
expect(edge.d).toBe('EFmitYRo5Dgijnr0rtQ0QW0A-MGPxozV3e4F6BUSVWSR'); | ||
expect(edge.le.n).toBe('my ecr auth credential said'); | ||
expect(edge.le.s).toBe(schema.LE); | ||
}); | ||
|
||
it('should create official organizational role authorization credential edge', () => { | ||
let data = | ||
new edges.OfficialOrganizationalRoleAuthorizationCredentialEdgeData( | ||
{ | ||
legalEntityCredentialSAID: 'my ecr auth credential said', | ||
} | ||
); | ||
|
||
let edge = new edges.OfficialOrganizationalRoleAuthorizationEdge({ | ||
le: data, | ||
}); | ||
|
||
expect(data.d).toBe('EN04IEg4A-w_CN8-hb2YfZsl9k7pyH9uUOYJR2rhbWKn'); | ||
expect(data.i).toBe('issuee'); | ||
expect(data.dt).toBe('timestamp'); | ||
expect(data.LEI).toBe('lei'); | ||
expect(edge.d).toBe('EFmitYRo5Dgijnr0rtQ0QW0A-MGPxozV3e4F6BUSVWSR'); | ||
expect(edge.le.n).toBe('my ecr auth credential said'); | ||
expect(edge.le.s).toBe(schema.LE); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters