Skip to content

Commit

Permalink
Update relatedResource test to test mediaType.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBlueHat committed Aug 15, 2024
1 parent c7de515 commit 9d2de46
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/50-advanced-concepts.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ describe('Advanced Concepts', function() {
await assert.doesNotReject(endpoints.issue(require(
'./input/relatedResource/relatedResource-ok.json'
)), 'Failed to accept a VC with valid relatedResource objects.');
await assert.doesNotReject(endpoints.issue(require(
'./input/relatedResource/relatedResource-with-mediaType-ok.json'
)),
'Failed to accept a VC with valid relatedResource.mediaType values.');
await assert.rejects(endpoints.issue(require(
'./input/relatedResource/relatedResource-list-of-strings-fail.json'
)),
Expand Down
21 changes: 21 additions & 0 deletions tests/input/relatedResource/relatedResource-with-mediaType-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2"
],
"type": [
"VerifiableCredential"
],
"credentialSubject": {
"id": "did:example:subject"
},
"relatedResource": [{
"id": "https://www.w3.org/ns/credentials/v2",
"digestMultibase": "uEres1usWcWCmW7uolIW2uA0CjQ8iRV14eGaZStJL73Vz",
"mediaType": "application/json"
},{
"id": "https://www.w3.org/ns/credentials/examples/v2",
"digestSRI":
"sha384-zNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68M26",
"mediaType": "application/ld+json"
}]
}

0 comments on commit 9d2de46

Please sign in to comment.