@@ -104,12 +104,32 @@ export function runDataIntegrityProofVerifyTests({
104104 reason : 'MUST not verify VC w/o "proof.proofPurpose"'
105105 } ) ;
106106 } ) ;
107- it ( `If the "proof.type" field is not the string ` +
108- `"${ expectedProofType } ", an error MUST be raised.` ,
109- async function ( ) {
110- const credential = credentials . clone ( 'invalidProofType' ) ;
111- await verificationFail ( { credential, verifier} ) ;
112- } ) ;
107+ // use updated statement for DataIntegrityProof tests
108+ if ( expectedProofType === 'DataIntegrityProof' ) {
109+ it ( 'The type property MUST contain the string DataIntegrityProof.' ,
110+ async function ( ) {
111+ this . test . link = 'https://w3c.github.io/vc-data-integrity/#proofs:~:text=The%20type%20property%20MUST%20contain%20the%20string%20DataIntegrityProof.' ;
112+ const credential = credentials . clone ( 'invalidProofType' ) ;
113+ await verificationFail ( {
114+ credential,
115+ verifier,
116+ reason : 'Should not verify VC with invalid "proof.type"'
117+ } ) ;
118+ } ) ;
119+ } else {
120+ // if the expectedProofType if Ed25519Sig etc. use the
121+ // deprecated statement
122+ it ( `If the "proof.type" field is not the string ` +
123+ `"${ expectedProofType } ", an error MUST be raised.` ,
124+ async function ( ) {
125+ const credential = credentials . clone ( 'invalidProofType' ) ;
126+ await verificationFail ( {
127+ credential,
128+ verifier,
129+ reason : 'Should not verify VC with invalid "proof.type"'
130+ } ) ;
131+ } ) ;
132+ }
113133 it ( 'If the "proof.verificationMethod" field is invalid, an error ' +
114134 'MUST be raised.' , async function ( ) {
115135 const credential = credentials . clone ( 'invalidVm' ) ;
0 commit comments