Skip to content

Commit

Permalink
Add multi direction test.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jun 10, 2024
1 parent c2f04b6 commit 3e626cf
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
14 changes: 14 additions & 0 deletions test/10-issue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,20 @@ for(const [version, mockCredential] of versionedCredentials) {
verifiableCredential.should.have.property('proof');
verifiableCredential.proof.should.be.an('object');
});
it('should issue a VC with multiple languages & directions',
async function() {
const credential = structuredClone(
credentials.features.multiple.directions);
const verifiableCredential = await vc.issue({
credential,
suite,
documentLoader
});
verifiableCredential.should.exist;
verifiableCredential.should.be.an('object');
verifiableCredential.should.have.property('proof');
verifiableCredential.proof.should.be.an('object');
});
it('should issue a VC with a single language', async function() {
const credential = structuredClone(
credentials.features.single.language);
Expand Down
28 changes: 28 additions & 0 deletions test/mocks/credential-issuer-multi-direction-name-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2"
],
"type": [
"VerifiableCredential"
],
"issuer": {
"id": "did:issuer:dog",
"name": [{
"@value":"Dog",
"@language": "en",
"@direction": "ltr"
}, {
"@value":"Chien",
"@language": "fr",
"@direction": "ltr"

}, {
"@value":"Cane",
"@language": "it",
"@direction": "ltr"
}]
},
"credentialSubject": {
"id": "did:example:subject"
}
}
2 changes: 1 addition & 1 deletion test/mocks/mock.data.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ credentials.mixed = _mixedCredential();
credentials.features = {
multiple: {
languages: require('./credential-issuer-multi-language-description-ok.json'),
directions: null
directions: require('./credential-issuer-multi-direction-name-ok.json')
},
single: {
language: require('./credential-issuer-name-language-en-ok.json'),
Expand Down

0 comments on commit 3e626cf

Please sign in to comment.