diff --git a/tests/suites/algorithms-jcs.js b/tests/suites/algorithms-jcs.js index 3543f9b..5c55a95 100644 --- a/tests/suites/algorithms-jcs.js +++ b/tests/suites/algorithms-jcs.js @@ -15,6 +15,8 @@ import { import chai from 'chai'; import {endpoints} from 'vc-test-suite-implementations'; +const should = chai.should(); + export function ecdsaJcs2019Algorithms() { const cryptosuite = 'ecdsa-jcs-2019'; const {tags} = config.suites[ @@ -24,7 +26,6 @@ export function ecdsaJcs2019Algorithms() { tags: [...tags], property: 'issuers' }); - const should = chai.should(); describe('ecdsa-jcs-2019 - Algorithms - Transformation', function() { setupReportableTestSuite(this); @@ -55,6 +56,17 @@ export function ecdsaJcs2019Algorithms() { jcs2019Proofs.length.should.be.gte(1, 'Expected at least one ' + 'ecdsa-jcs-2019 cryptosuite.'); }; + it('The proof options MUST contain a type identifier for the ' + + 'cryptographic suite (type) and MAY contain a cryptosuite ' + + 'identifier (cryptosuite).', + async function() { + this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-serialization-ecdsa-jcs-2019'; + assertBefore(); + for(const proof of jcs2019Proofs) { + should.exist(proof.type, + 'Expected a type identifier on the proof.'); + } + }); it('The transformation options MUST contain a type identifier ' + 'for the cryptographic suite (type) and a cryptosuite identifier ' + '(cryptosuite).', @@ -181,48 +193,4 @@ export function ecdsaJcs2019Algorithms() { }); } }); - - describe('ecdsa-jcs-2019 - Algorithms - Transformation', function() { - setupReportableTestSuite(this); - this.implemented = [...issuers.keys()]; - let validCredential; - before(async function() { - validCredential = await createValidCredential(); - }); - for(const [columnId, {endpoints}] of issuers) { - describe(columnId, function() { - const [issuer] = endpoints; - let issuedVc; - let proofs; - let jcs2019Proofs = []; - before(async function() { - issuedVc = await createInitialVc({issuer, vc: validCredential}); - proofs = getProofs(issuedVc); - if(proofs?.length) { - jcs2019Proofs = proofs.filter( - proof => proof?.cryptosuite === cryptosuite); - } - }); - beforeEach(setupRow); - const assertBefore = () => { - should.exist(issuedVc, 'Expected issuer to have issued a ' + - 'credential.'); - should.exist(proofs, 'Expected credential to have a proof.'); - jcs2019Proofs.length.should.be.gte(1, 'Expected at least one ' + - 'ecdsa-jcs-2019 cryptosuite.'); - }; - it('The proof options MUST contain a type identifier for the ' + - 'cryptographic suite (type) and MAY contain a cryptosuite ' + - 'identifier (cryptosuite).', - async function() { - this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-serialization-ecdsa-jcs-2019'; - assertBefore(); - for(const proof of jcs2019Proofs) { - should.exist(proof.type, - 'Expected a type identifier on the proof.'); - } - }); - }); - } - }); }