@@ -15,6 +15,8 @@ import {
15
15
import chai from 'chai' ;
16
16
import { endpoints } from 'vc-test-suite-implementations' ;
17
17
18
+ const should = chai . should ( ) ;
19
+
18
20
export function ecdsaJcs2019Algorithms ( ) {
19
21
const cryptosuite = 'ecdsa-jcs-2019' ;
20
22
const { tags} = config . suites [
@@ -24,7 +26,6 @@ export function ecdsaJcs2019Algorithms() {
24
26
tags : [ ...tags ] ,
25
27
property : 'issuers'
26
28
} ) ;
27
- const should = chai . should ( ) ;
28
29
29
30
describe ( 'ecdsa-jcs-2019 - Algorithms - Transformation' , function ( ) {
30
31
setupReportableTestSuite ( this ) ;
@@ -55,6 +56,17 @@ export function ecdsaJcs2019Algorithms() {
55
56
jcs2019Proofs . length . should . be . gte ( 1 , 'Expected at least one ' +
56
57
'ecdsa-jcs-2019 cryptosuite.' ) ;
57
58
} ;
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
+ } ) ;
58
70
it ( 'The transformation options MUST contain a type identifier ' +
59
71
'for the cryptographic suite (type) and a cryptosuite identifier ' +
60
72
'(cryptosuite).' ,
@@ -181,48 +193,4 @@ export function ecdsaJcs2019Algorithms() {
181
193
} ) ;
182
194
}
183
195
} ) ;
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
- } ) ;
228
196
}
0 commit comments