Skip to content

Commit 1771eba

Browse files
committed
Minor corrections to jcs suite.
1 parent 8cdd7d4 commit 1771eba

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

tests/helpers.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,14 @@ export function getColumnNameForTestCategory(testCategory) {
210210
}
211211
}
212212

213-
export function setupReportableTestSuite(runnerContext, name) {
213+
export function setupReportableTestSuite(
214+
runnerContext,
215+
name = 'Implementation'
216+
) {
214217
runnerContext.matrix = true;
215218
runnerContext.report = true;
216219
runnerContext.rowLabel = 'Test Name';
217220
runnerContext.columnLabel = name;
218-
219221
runnerContext.implemented = [];
220222
}
221223

@@ -233,16 +235,6 @@ export function isValidDatetime(dateString) {
233235
return !isNaN(Date.parse(dateString));
234236
}
235237

236-
export function setupMatrix(match) {
237-
// this will tell the report
238-
// to make an interop matrix with this suite
239-
this.matrix = true;
240-
this.report = true;
241-
this.implemented = [...match.keys()];
242-
this.rowLabel = 'Test Name';
243-
this.columnLabel = 'Implementer';
244-
}
245-
246238
export const config = JSON.parse(readFileSync('./config/runner.json'));
247239

248240
export function createValidCredential(version = 2) {

tests/suites/algorithms-jcs.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
getProofs,
1010
isValidDatetime,
1111
isValidUtf8,
12-
setupMatrix,
12+
setupReportableTestSuite,
1313
setupRow
1414
} from '../helpers.js';
1515
import chai from 'chai';
@@ -20,7 +20,7 @@ export function ecdsaJcs2019Algorithms() {
2020
const {tags} = config.suites[
2121
cryptosuite
2222
];
23-
const {issuerMatch} = endpoints.filterByTag({
23+
const {match: issuers} = endpoints.filterByTag({
2424
tags: [...tags],
2525
property: 'issuers'
2626
});
@@ -31,12 +31,12 @@ export function ecdsaJcs2019Algorithms() {
3131
const should = chai.should();
3232

3333
describe('ecdsa-jcs-2019 - Algorithms - Transformation', function() {
34-
setupMatrix.call(this, issuerMatch);
34+
setupReportableTestSuite(this);
3535
let validCredential;
3636
before(async function() {
3737
validCredential = await createValidCredential();
3838
});
39-
for(const [columnId, {endpoints}] of issuerMatch) {
39+
for(const [columnId, {endpoints}] of issuers) {
4040
describe(columnId, function() {
4141
const [issuer] = endpoints;
4242
let issuedVc;
@@ -99,21 +99,21 @@ export function ecdsaJcs2019Algorithms() {
9999
'Expected a cryptosuite identifier on the proof.');
100100
proof.type.should.equal('DataIntegrityProof',
101101
'Expected DataIntegrityProof type.');
102-
proof.cryptosuite.should.equal('ecdsa-jcs-2022',
103-
'Expected ecdsa-jcs-2022 cryptosuite.');
102+
proof.cryptosuite.should.equal('ecdsa-jcs-2019',
103+
'Expected ecdsa-jcs-2019 cryptosuite.');
104104
}
105105
});
106106
});
107107
}
108108
});
109109

110110
describe('ecdsa-jcs-2019 - Algorithms - Proof Configuration', function() {
111-
setupMatrix.call(this, issuerMatch);
111+
setupReportableTestSuite(this);
112112
let validCredential;
113113
before(async function() {
114114
validCredential = await createValidCredential();
115115
});
116-
for(const [columnId, {endpoints}] of issuerMatch) {
116+
for(const [columnId, {endpoints}] of issuers) {
117117
describe(columnId, function() {
118118
const [issuer] = endpoints;
119119
let issuedVc;
@@ -162,8 +162,8 @@ export function ecdsaJcs2019Algorithms() {
162162
'Expected a cryptosuite identifier on the proof.');
163163
proof.type.should.equal('DataIntegrityProof',
164164
'Expected DataIntegrityProof type.');
165-
proof.cryptosuite.should.equal('ecdsa-jcs-2022',
166-
'Expected ecdsa-jcs-2022 cryptosuite.');
165+
proof.cryptosuite.should.equal('ecdsa-jcs-2019',
166+
'Expected ecdsa-jcs-2019 cryptosuite.');
167167
}
168168
});
169169
it('If proofConfig.created is set and if the value is not a ' +
@@ -185,12 +185,12 @@ export function ecdsaJcs2019Algorithms() {
185185
});
186186

187187
describe('ecdsa-jcs-2019 - Algorithms - Transformation', function() {
188-
setupMatrix.call(this, issuerMatch);
188+
setupReportableTestSuite(this);
189189
let validCredential;
190190
before(async function() {
191191
validCredential = await createValidCredential();
192192
});
193-
for(const [columnId, {endpoints}] of issuerMatch) {
193+
for(const [columnId, {endpoints}] of issuers) {
194194
describe(columnId, function() {
195195
const [issuer] = endpoints;
196196
let issuedVc;

0 commit comments

Comments
 (0)