diff --git a/test/10-issue.spec.js b/test/10-issue.spec.js index 18766353..cbcb483d 100644 --- a/test/10-issue.spec.js +++ b/test/10-issue.spec.js @@ -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); diff --git a/test/mocks/credential-issuer-multi-direction-name-ok.json b/test/mocks/credential-issuer-multi-direction-name-ok.json new file mode 100644 index 00000000..3b7c9380 --- /dev/null +++ b/test/mocks/credential-issuer-multi-direction-name-ok.json @@ -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" + } +} diff --git a/test/mocks/mock.data.js b/test/mocks/mock.data.js index 38c585ea..052d5055 100644 --- a/test/mocks/mock.data.js +++ b/test/mocks/mock.data.js @@ -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'),