Skip to content

Commit

Permalink
Add 3 new issuer name internationalization tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Dec 13, 2023
1 parent e738c7e commit 8af068a
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tests/10-vcdm2.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,12 @@ describe('Verifiable Credentials Data Model v2.0', function() {
await issue(require('./input/credential-issuer-name-ok.json'));
await issue(require(
'./input/credential-issuer-name-language-en-ok.json'));
await issue(require(
'./input/credential-issuer-name-language-direction-en-ok.json'));
await issue(require(
'./input/credential-issuer-multi-language-name-ok.json'));
await assert.rejects(issue(require(
'./input/credential-issuer-name-extra-prop-en-fail.json')));
});
it2('If present, the value of the validFrom property MUST be an ' +
'[XMLSCHEMA11-2] dateTimeStamp string value representing the date ' +
Expand Down
24 changes: 24 additions & 0 deletions tests/input/credential-issuer-multi-language-name-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2"
],
"type": [
"VerifiableCredential"
],
"issuer": {
"id": "did:issuer:dog",
"name": [{
"@value":"Dog",
"@language": "en"
}, {
"@value":"Chien",
"@language": "fr"
}, {
"@value":"Cane",
"@language": "it"
}]
},
"credentialSubject": {
"id": "did:example:subject"
}
}
19 changes: 19 additions & 0 deletions tests/input/credential-issuer-name-extra-prop-en-fail.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2"
],
"type": [
"VerifiableCredential"
],
"issuer": {
"id": "did:example:issuer",
"name": {
"@value":"ExampleIssuer",
"@language": "en",
"url": "did:example:issuer"
}
},
"credentialSubject": {
"id": "did:example:subject"
}
}
19 changes: 19 additions & 0 deletions tests/input/credential-issuer-name-language-direction-en-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2"
],
"type": [
"VerifiableCredential"
],
"issuer": {
"id": "did:example:issuer",
"name": {
"@value":"ExampleIssuer",
"@language": "en",
"@direction": "ltr"
}
},
"credentialSubject": {
"id": "did:example:subject"
}
}
1 change: 0 additions & 1 deletion tests/input/credential-issuer-name-language-en-ok.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"type": [
"VerifiableCredential"
],
"validFrom": "2023-02-26T00:37:06Z",
"issuer": {
"id": "did:example:issuer",
"name": {
Expand Down
1 change: 0 additions & 1 deletion tests/input/credential-issuer-name-ok.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"type": [
"VerifiableCredential"
],
"validFrom": "2023-02-26T00:37:06Z",
"issuer": {
"id": "did:example:issuer",
"name": "ExampleIssuer"
Expand Down

0 comments on commit 8af068a

Please sign in to comment.