Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate VC & VP context order tests. #42

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions tests/10-vcdm2.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,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 @@ -177,10 +184,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