Skip to content

Commit

Permalink
Separate VC & VP context order tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Dec 11, 2023
1 parent b340513 commit 2171717
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/10-vcdm2.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,20 @@ describe('Verifiable Credentials Data Model v2.0', function() {
await assert.rejects(verifyVp(
require('./input/presentation-no-context-fail.json')));
});
it2('Verifiable credentials and verifiable presentations: ' +
'The value of the @context property MUST be an ordered set where ' +
'the first item is a URL with the value https://www.w3.org/ns/' +
'credentials/v2.', async function() {
it2('Verifiable credentials: The value of the @context property MUST' +
'be an ordered set where the first item is a URL with the value' +
'https://www.w3.org/ns/credentials/v2.', async function() {
//positive issue test
const vc = await issue(require('./input/credential-ok.json'));
assert(Array.isArray(vc['@context']));
assert.strictEqual(vc['@context'][0], baseContextUrl);
// negative issue test
await assert.rejects(issue(
require('./input/credential-missing-base-context-fail.json')));
});
it2('Verifiable presentations: The value of the @context property MUST' +
' be an ordered set where the first item is a URL with the value ' +
'https://www.w3.org/ns/credentials/v2.', async function() {
//FIXME reimplement this once signed VP creation via VC-API
//has been finalized
/*
Expand All @@ -173,10 +180,6 @@ describe('Verifiable Credentials Data Model v2.0', function() {
assert(Array.isArray(vp['@context']));
assert.strictEqual(vp['@context'][0], baseContextUrl);
*/
//FIXME this should be a verifier test
//as the tests above used an existing issued VC
await assert.rejects(issue(
require('./input/credential-missing-base-context-fail.json')));
await assert.rejects(verifyVp(
require('./input/presentation-missing-base-context-fail.json')));
});
Expand Down

0 comments on commit 2171717

Please sign in to comment.