@@ -68,14 +68,14 @@ describe('Enveloped Verifiable Credentials', function() {
68
68
negativeFixture = structuredClone ( verifiableCredential ) ;
69
69
negativeFixture [ '@context' ] = [ ] ;
70
70
await assert . rejects (
71
- verifyCredential ( { verifier, negativeFixture} ) ,
71
+ verifyCredential ( { verifier, verifiableCredential : negativeFixture } ) ,
72
72
'Failed to reject an enveloped VC with invalid context.' ) ;
73
73
74
74
// Replace context with an invalid value
75
75
negativeFixture = structuredClone ( verifiableCredential ) ;
76
76
negativeFixture [ '@context' ] = 'https://www.w3.org/ns/credentials/examples/v2' ;
77
77
await assert . rejects (
78
- verifyCredential ( { verifier, negativeFixture} ) ,
78
+ verifyCredential ( { verifier, verifiableCredential : negativeFixture } ) ,
79
79
'Failed to reject an enveloped VC with invalid context.' ) ;
80
80
}
81
81
} ) ;
@@ -101,7 +101,7 @@ describe('Enveloped Verifiable Credentials', function() {
101
101
negativeFixture = structuredClone ( verifiableCredential ) ;
102
102
negativeFixture . id = negativeFixture . id . split ( ',' ) . pop ( ) ;
103
103
await assert . rejects (
104
- verifyCredential ( { verifier, negativeFixture} ) ,
104
+ verifyCredential ( { verifier, verifiableCredential : negativeFixture } ) ,
105
105
'Failed to reject an enveloped VC with an invalid data url id.' ) ;
106
106
}
107
107
} ) ;
@@ -125,15 +125,17 @@ describe('Enveloped Verifiable Credentials', function() {
125
125
negativeFixture = structuredClone ( verifiableCredential ) ;
126
126
delete negativeFixture . type ;
127
127
await assert . rejects (
128
- verifyCredential ( { verifier, negativeFixture} ) ,
128
+ verifyCredential (
129
+ { verifier, verifiableCredential : negativeFixture } ) ,
129
130
'Failed to reject an enveloped VC with an enveloped VC with a ' +
130
131
'missing `type`.' ) ;
131
132
132
133
// Replace type field
133
134
negativeFixture = structuredClone ( verifiableCredential ) ;
134
135
negativeFixture . type = 'VerifiableCredential' ;
135
136
await assert . rejects (
136
- verifyCredential ( { verifier, negativeFixture} ) ,
137
+ verifyCredential (
138
+ { verifier, verifiableCredential : negativeFixture } ) ,
137
139
'Failed to reject an enveloped VC with an ' +
138
140
'invalid `type`.' ) ;
139
141
}
@@ -176,14 +178,16 @@ describe('Enveloped Verifiable Presentations', function() {
176
178
negativeFixture = structuredClone ( verifiablePresentation ) ;
177
179
negativeFixture [ '@context' ] = [ ] ;
178
180
await assert . rejects (
179
- verifyPresentation ( { vpVerifier, negativeFixture} ) ,
181
+ verifyPresentation (
182
+ { vpVerifier, verifiablePresentation : negativeFixture } ) ,
180
183
'Failed to reject Enveloped VP missing contexts.' ) ;
181
184
182
185
// Replace context field with invalid context
183
186
negativeFixture = structuredClone ( verifiablePresentation ) ;
184
187
negativeFixture [ '@context' ] = [ 'https://www.w3.org/ns/credentials/examples/v2' ] ;
185
188
await assert . rejects (
186
- verifyPresentation ( { vpVerifier, negativeFixture} ) ,
189
+ verifyPresentation (
190
+ { vpVerifier, verifiablePresentation : negativeFixture } ) ,
187
191
'Failed to reject Enveloped VP missing contexts.' ) ;
188
192
}
189
193
} ) ;
@@ -203,7 +207,8 @@ describe('Enveloped Verifiable Presentations', function() {
203
207
negativeFixture = structuredClone ( verifiablePresentation ) ;
204
208
negativeFixture . id = negativeFixture . id . split ( ',' ) . pop ( ) ;
205
209
await assert . rejects (
206
- verifyPresentation ( { vpVerifier, negativeFixture} ) ,
210
+ verifyPresentation (
211
+ { vpVerifier, verifiablePresentation : negativeFixture } ) ,
207
212
'Failed to reject Enveloped VP with an id that is not a data url.' ) ;
208
213
}
209
214
} ) ;
@@ -221,7 +226,8 @@ describe('Enveloped Verifiable Presentations', function() {
221
226
negativeFixture = structuredClone ( verifiablePresentation ) ;
222
227
negativeFixture . type = [ 'VerifiablePresentation' ] ;
223
228
await assert . rejects (
224
- verifyPresentation ( { vpVerifier, negativeFixture} ) ,
229
+ verifyPresentation (
230
+ { vpVerifier, verifiablePresentation : negativeFixture } ) ,
225
231
'Failed to reject VP w/o type "EnvelopedVerifiablePresentation".' ) ;
226
232
}
227
233
} ) ;
0 commit comments