Skip to content

Commit

Permalink
Add test for type url order.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Dec 11, 2023
1 parent b340513 commit 8e647fb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/10-vcdm2.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,12 @@ describe('Verifiable Credentials Data Model v2.0', function() {
await assert.rejects(
issue(require('./input/credential-type-unmapped-fail.json')));
});
//FIXME how to test this?
it.skip('type property: "If more than one URL is provided, the URLs ' +
it('type property: "If more than one URL is provided, the URLs ' +
'MUST be interpreted as an unordered set."', async function() {
//issue VC with multiple urls in type property
await issue(require('./input/credential-type-urls-order-1-ok.json'));
//issue another VC with same urls in a different order
await issue(require('./input/credential-type-urls-order-2-ok.json'));
});
// FIXME this needs to be expanded into at least 6 different tests
// Verifiable Credential MUST have a type specified
Expand Down
15 changes: 15 additions & 0 deletions tests/input/credential-type-urls-order-1-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2"
],
"type": [
"VerifiableCredential",
"https://example.org/#ExampleCredential1",
"https://example.org/#ExampleCredential2"
],
"validFrom": "2023-02-23T21:41:38Z",
"issuer": "did:example:issuer",
"credentialSubject": {
"id": "did:example:subject"
}
}
15 changes: 15 additions & 0 deletions tests/input/credential-type-urls-order-2-ok.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2"
],
"type": [
"VerifiableCredential",
"https://example.org/#ExampleCredential2",
"https://example.org/#ExampleCredential1"
],
"validFrom": "2023-02-23T21:41:38Z",
"issuer": "did:example:issuer",
"credentialSubject": {
"id": "did:example:subject"
}
}

0 comments on commit 8e647fb

Please sign in to comment.