Skip to content

Fix empty report sections #115

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions tests/90-algorithms-jcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe('Algorithms - Create Proof (ecdsa-jcs-2019)', function() {

describe('Algorithms - Verify Proof (ecdsa-jcs-2019)', function() {
setupReportableTestSuite(this);
this.implemented = [...verifiers.keys()];
for(const [columnId, {endpoints}] of verifiers) {
describe(columnId, function() {
const [verifier] = endpoints;
Expand Down
1 change: 1 addition & 0 deletions tests/90-algorithms-rdfc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('Algorithms - Create Proof (ecdsa-rdfc-2019)', function() {

describe('Algorithms - Verify Proof (ecdsa-rdfc-2019)', function() {
setupReportableTestSuite(this);
this.implemented = [...verifiers.keys()];
for(const [columnId, {endpoints}] of verifiers) {
describe(columnId, function() {
const [verifier] = endpoints;
Expand Down
82 changes: 42 additions & 40 deletions tests/90-algorithms-sd.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,54 +139,56 @@ describe('Algorithms - Base Proof Transformation (ecdsa-sd-2023)', function() {
}
});

describe('Algorithms - Base Proof Configuration (ecdsa-sd-2023)', function() {
setupReportableTestSuite(this);
this.implemented = [...issuers.keys()];
for(const [columnId, {endpoints}] of issuers) {
describe(columnId, function() {
const [issuer] = endpoints;
let securedCredential;
before(async function() {
const mandatoryPointers = ['/credentialSubject/name'];
securedCredential = await secureCredential(
{issuer, vc: generateCredential(), mandatoryPointers});
});
it('The proof options MUST contain a type identifier for the ' +
describe('Algorithms - Base Proof Configuration',
function() {
setupReportableTestSuite(this);
this.implemented = [...issuers.keys()];
for(const [columnId, {endpoints}] of issuers) {
describe(columnId, function() {
const [issuer] = endpoints;
let securedCredential;
before(async function() {
const mandatoryPointers = ['/credentialSubject/name'];
securedCredential = await secureCredential(
{issuer, vc: generateCredential(), mandatoryPointers});
});
beforeEach(setupRow);
it('The proof options MUST contain a type identifier for the ' +
'cryptographic suite (type) and MUST contain a cryptosuite ' +
'identifier (cryptosuite).',
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
const proof = proofExists(securedCredential);
should.exist(proof.type,
'Expected a type identifier on the proof.');
should.exist(proof.cryptosuite,
'Expected a cryptosuite identifier on the proof.');
});
it('If proofConfig.type is not set to DataIntegrityProof and/or ' +
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
const proof = proofExists(securedCredential);
should.exist(proof.type,
'Expected a type identifier on the proof.');
should.exist(proof.cryptosuite,
'Expected a cryptosuite identifier on the proof.');
});
it('If proofConfig.type is not set to DataIntegrityProof and/or ' +
'proofConfig.cryptosuite is not set to ecdsa-sd-2023, ' +
'an error MUST be raised and SHOULD convey an error type of ' +
'PROOF_GENERATION_ERROR.',
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
const proof = proofExists(securedCredential);
assertCryptosuiteProof(proof, 'ecdsa-sd-2023');
});
it('If proofConfig.created is set and if the value is not a ' +
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
const proof = proofExists(securedCredential);
assertCryptosuiteProof(proof, 'ecdsa-sd-2023');
});
it('If proofConfig.created is set and if the value is not a ' +
'valid [XMLSCHEMA11-2] datetime, an error MUST be raised and ' +
'SHOULD convey an error type of PROOF_GENERATION_ERROR.',
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
const proof = proofExists(securedCredential);
if(proof?.created) {
isValidDatetime(proof.created).should.equal(
true,
'Expected created value to be a valid datetime string.'
);
}
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
const proof = proofExists(securedCredential);
if(proof?.created) {
isValidDatetime(proof.created).should.equal(
true,
'Expected created value to be a valid datetime string.'
);
}
});
});
});
}
});
}
});

describe('Algorithms - Base Proof Serialization (ecdsa-sd-2023)', function() {
setupReportableTestSuite(this);
Expand Down
Loading