@@ -16,7 +16,7 @@ export function dataModelSuite({
16
16
credential,
17
17
mandatoryPointers
18
18
} ) {
19
- describe ( `${ suiteName } - Data Model - VC ${ vcVersion } ` , function ( ) {
19
+ return describe ( `${ suiteName } - Data Model - VC ${ vcVersion } ` , function ( ) {
20
20
this . matrix = true ;
21
21
this . report = true ;
22
22
this . implemented = [ ...issuers ] ;
@@ -30,13 +30,20 @@ export function dataModelSuite({
30
30
}
31
31
describe ( `${ name } : ${ keyType } ` , function ( ) {
32
32
let securedCredential = null ;
33
+ let proofs = [ ] ;
33
34
before ( async function ( ) {
34
35
securedCredential = await createInitialVc ( {
35
36
issuer,
36
37
vcVersion,
37
38
vc : credential ,
38
39
mandatoryPointers
39
40
} ) ;
41
+ if ( securedCredential ) {
42
+ proofs = Array . isArray ( securedCredential . proofs ) ?
43
+ securedCredential ?. proofs : [ securedCredential ?. proofs ] ;
44
+ // only test proofs that match the relevant cryptosuite
45
+ proofs . filter ( p => p . cryptosuite === suiteName ) ;
46
+ }
40
47
} ) ;
41
48
beforeEach ( function ( ) {
42
49
this . currentTest . cell = {
@@ -49,6 +56,10 @@ export function dataModelSuite({
49
56
securedCredential ,
50
57
`Expected issuer ${ name } : ${ keyType } to issue a VC`
51
58
) . to . exist ;
59
+ expect (
60
+ securedCredential ,
61
+ 'Expected VC to be an object'
62
+ ) . to . be . an ( 'object' ) ;
52
63
}
53
64
it ( 'The publicKeyMultibase value of the verification method MUST ' +
54
65
'start with the base-58-btc prefix (z), as defined in the ' +
@@ -58,6 +69,14 @@ export function dataModelSuite({
58
69
async function ( ) {
59
70
this . test . link = 'https://w3c.github.io/vc-di-eddsa/#data-model:~:text=in%20this%20specification.-,The%20publicKeyMultibase%20value%20of%20the%20verification%20method%20MUST%20start%20with%20the%20base%2D58%2Dbtc%20prefix,-(z)%2C%20as' ;
60
71
assertBefore ( ) ;
72
+ for ( const proof of proofs ) {
73
+ expect ( proof . verificationMethod ) . to . exist ;
74
+ expect ( proof . verificationMethod ) . to . be . a ( 'string' ) ;
75
+ expect (
76
+ assertions . shouldBeBs58 ( proof . verificationMethod ) ,
77
+ 'Expected "proof.verificationMethod" to be Base58 encoded'
78
+ ) . to . be . true ;
79
+ }
61
80
} ) ;
62
81
it ( 'Any other encoding MUST NOT be allowed. (verificationMethod)' ,
63
82
async function ( ) {
0 commit comments