Skip to content

Commit d87804b

Browse files
committed
Move lone transformation test to main area.
1 parent 32ad109 commit d87804b

File tree

1 file changed

+13
-45
lines changed

1 file changed

+13
-45
lines changed

tests/suites/algorithms-jcs.js

Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515
import chai from 'chai';
1616
import {endpoints} from 'vc-test-suite-implementations';
1717

18+
const should = chai.should();
19+
1820
export function ecdsaJcs2019Algorithms() {
1921
const cryptosuite = 'ecdsa-jcs-2019';
2022
const {tags} = config.suites[
@@ -24,7 +26,6 @@ export function ecdsaJcs2019Algorithms() {
2426
tags: [...tags],
2527
property: 'issuers'
2628
});
27-
const should = chai.should();
2829

2930
describe('ecdsa-jcs-2019 - Algorithms - Transformation', function() {
3031
setupReportableTestSuite(this);
@@ -55,6 +56,17 @@ export function ecdsaJcs2019Algorithms() {
5556
jcs2019Proofs.length.should.be.gte(1, 'Expected at least one ' +
5657
'ecdsa-jcs-2019 cryptosuite.');
5758
};
59+
it('The proof options MUST contain a type identifier for the ' +
60+
'cryptographic suite (type) and MAY contain a cryptosuite ' +
61+
'identifier (cryptosuite).',
62+
async function() {
63+
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-serialization-ecdsa-jcs-2019';
64+
assertBefore();
65+
for(const proof of jcs2019Proofs) {
66+
should.exist(proof.type,
67+
'Expected a type identifier on the proof.');
68+
}
69+
});
5870
it('The transformation options MUST contain a type identifier ' +
5971
'for the cryptographic suite (type) and a cryptosuite identifier ' +
6072
'(cryptosuite).',
@@ -181,48 +193,4 @@ export function ecdsaJcs2019Algorithms() {
181193
});
182194
}
183195
});
184-
185-
describe('ecdsa-jcs-2019 - Algorithms - Transformation', function() {
186-
setupReportableTestSuite(this);
187-
this.implemented = [...issuers.keys()];
188-
let validCredential;
189-
before(async function() {
190-
validCredential = await createValidCredential();
191-
});
192-
for(const [columnId, {endpoints}] of issuers) {
193-
describe(columnId, function() {
194-
const [issuer] = endpoints;
195-
let issuedVc;
196-
let proofs;
197-
let jcs2019Proofs = [];
198-
before(async function() {
199-
issuedVc = await createInitialVc({issuer, vc: validCredential});
200-
proofs = getProofs(issuedVc);
201-
if(proofs?.length) {
202-
jcs2019Proofs = proofs.filter(
203-
proof => proof?.cryptosuite === cryptosuite);
204-
}
205-
});
206-
beforeEach(setupRow);
207-
const assertBefore = () => {
208-
should.exist(issuedVc, 'Expected issuer to have issued a ' +
209-
'credential.');
210-
should.exist(proofs, 'Expected credential to have a proof.');
211-
jcs2019Proofs.length.should.be.gte(1, 'Expected at least one ' +
212-
'ecdsa-jcs-2019 cryptosuite.');
213-
};
214-
it('The proof options MUST contain a type identifier for the ' +
215-
'cryptographic suite (type) and MAY contain a cryptosuite ' +
216-
'identifier (cryptosuite).',
217-
async function() {
218-
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-serialization-ecdsa-jcs-2019';
219-
assertBefore();
220-
for(const proof of jcs2019Proofs) {
221-
should.exist(proof.type,
222-
'Expected a type identifier on the proof.');
223-
}
224-
});
225-
});
226-
}
227-
});
228196
}

0 commit comments

Comments
 (0)