Skip to content

Commit 865275b

Browse files
PatStLouisBigBlueHat
authored andcommitted
change test description for base proof config
Signed-off-by: PatStLouis <[email protected]>
1 parent e28bae3 commit 865275b

File tree

1 file changed

+52
-52
lines changed

1 file changed

+52
-52
lines changed

tests/90-algorithms-sd.js

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
*/
55
import {
66
assertAllUtf8,
7-
// assertCryptosuiteProof,
7+
assertCryptosuiteProof,
88
assertDataIntegrityProof
99
} from './assertions.js';
1010
import {
1111
encodeSdDerivedProofValue,
1212
generateCredential,
1313
inspectSdBaseProofValue,
1414
inspectSdDerivedProofValue,
15-
// isValidDatetime,
15+
isValidDatetime,
1616
proofExists,
1717
secureCredential,
1818
setupReportableTestSuite,
@@ -139,56 +139,56 @@ describe('Algorithms - Base Proof Transformation (ecdsa-sd-2023)', function() {
139139
}
140140
});
141141

142-
// TODO, these tests are not appearing in the report so commenting out
143-
// describe('Algorithms - Base Proof Configuration (ecdsa-sd-2023)',
144-
// function() {
145-
// setupReportableTestSuite(this);
146-
// this.implemented = [...issuers.keys()];
147-
// for(const [columnId, {endpoints}] of issuers) {
148-
// describe(columnId, function() {
149-
// const [issuer] = endpoints;
150-
// let securedCredential;
151-
// before(async function() {
152-
// const mandatoryPointers = ['/credentialSubject/name'];
153-
// securedCredential = await secureCredential(
154-
// {issuer, vc: generateCredential(), mandatoryPointers});
155-
// });
156-
// it('The proof options MUST contain a type identifier for the ' +
157-
// 'cryptographic suite (type) and MUST contain a cryptosuite ' +
158-
// 'identifier (cryptosuite).',
159-
// async function() {
160-
// this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
161-
// const proof = proofExists(securedCredential);
162-
// should.exist(proof.type,
163-
// 'Expected a type identifier on the proof.');
164-
// should.exist(proof.cryptosuite,
165-
// 'Expected a cryptosuite identifier on the proof.');
166-
// });
167-
// it('If proofConfig.type is not set to DataIntegrityProof and/or ' +
168-
// 'proofConfig.cryptosuite is not set to ecdsa-sd-2023, ' +
169-
// 'an error MUST be raised and SHOULD convey an error type of ' +
170-
// 'PROOF_GENERATION_ERROR.',
171-
// async function() {
172-
// this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
173-
// const proof = proofExists(securedCredential);
174-
// assertCryptosuiteProof(proof, 'ecdsa-sd-2023');
175-
// });
176-
// it('If proofConfig.created is set and if the value is not a ' +
177-
// 'valid [XMLSCHEMA11-2] datetime, an error MUST be raised and ' +
178-
// 'SHOULD convey an error type of PROOF_GENERATION_ERROR.',
179-
// async function() {
180-
// this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
181-
// const proof = proofExists(securedCredential);
182-
// if(proof?.created) {
183-
// isValidDatetime(proof.created).should.equal(
184-
// true,
185-
// 'Expected created value to be a valid datetime string.'
186-
// );
187-
// }
188-
// });
189-
// });
190-
// }
191-
// });
142+
describe('Algorithms - Base Proof Configuration',
143+
function() {
144+
setupReportableTestSuite(this);
145+
this.implemented = [...issuers.keys()];
146+
for(const [columnId, {endpoints}] of issuers) {
147+
describe(columnId, function() {
148+
const [issuer] = endpoints;
149+
let securedCredential;
150+
before(async function() {
151+
const mandatoryPointers = ['/credentialSubject/name'];
152+
securedCredential = await secureCredential(
153+
{issuer, vc: generateCredential(), mandatoryPointers});
154+
});
155+
beforeEach(setupRow);
156+
it('The proof options MUST contain a type identifier for the ' +
157+
'cryptographic suite (type) and MUST contain a cryptosuite ' +
158+
'identifier (cryptosuite).',
159+
async function() {
160+
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
161+
const proof = proofExists(securedCredential);
162+
should.exist(proof.type,
163+
'Expected a type identifier on the proof.');
164+
should.exist(proof.cryptosuite,
165+
'Expected a cryptosuite identifier on the proof.');
166+
});
167+
it('If proofConfig.type is not set to DataIntegrityProof and/or ' +
168+
'proofConfig.cryptosuite is not set to ecdsa-sd-2023, ' +
169+
'an error MUST be raised and SHOULD convey an error type of ' +
170+
'PROOF_GENERATION_ERROR.',
171+
async function() {
172+
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
173+
const proof = proofExists(securedCredential);
174+
assertCryptosuiteProof(proof, 'ecdsa-sd-2023');
175+
});
176+
it('If proofConfig.created is set and if the value is not a ' +
177+
'valid [XMLSCHEMA11-2] datetime, an error MUST be raised and ' +
178+
'SHOULD convey an error type of PROOF_GENERATION_ERROR.',
179+
async function() {
180+
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-sd-2023';
181+
const proof = proofExists(securedCredential);
182+
if(proof?.created) {
183+
isValidDatetime(proof.created).should.equal(
184+
true,
185+
'Expected created value to be a valid datetime string.'
186+
);
187+
}
188+
});
189+
});
190+
}
191+
});
192192

193193
describe('Algorithms - Base Proof Serialization (ecdsa-sd-2023)', function() {
194194
setupReportableTestSuite(this);

0 commit comments

Comments
 (0)