@@ -122,6 +122,7 @@ describe('selectGenerativeInfo', function () {
122
122
'./node_modules/@contentauth/testing/fixtures/images/genai-actions-v2.jpg' ,
123
123
) ;
124
124
const manifest = result . manifestStore ?. activeManifest ;
125
+
125
126
expect ( manifest ) . not . toBeNull ( ) ;
126
127
if ( manifest ) {
127
128
const genAssertions = selectGenerativeInfo ( manifest ) ;
@@ -140,5 +141,118 @@ describe('selectGenerativeInfo', function () {
140
141
] ) ;
141
142
}
142
143
} ) ;
144
+
145
+ it ( 'should look up parameters details in assertion' , async function ( this : TestContext ) {
146
+ const manifest = {
147
+ label : 'urn:uuid:05f3b244-301a-49c4-ae14-c24bec024002' ,
148
+ title : 'An image for tests' ,
149
+ format : 'image/png' ,
150
+ vendor : null ,
151
+ claimGenerator : 'c2pa-js unit tests' ,
152
+ claimGeneratorHints : null ,
153
+ claimGeneratorInfo : [ ] ,
154
+ instanceId : 'xmp:iid:12fe9a47-8ad3-4ad1-b362-2ff987428e03' ,
155
+ signatureInfo : {
156
+ alg : 'Ps256' ,
157
+ issuer : 'Unit tests' ,
158
+ cert_serial_number : '11111' ,
159
+ time : '2025-03-31T13:36:22+00:00' ,
160
+ } ,
161
+ credentials : [ ] ,
162
+ ingredients : [
163
+ {
164
+ title : 'An Image' ,
165
+ format : 'image/png' ,
166
+ documentId : null ,
167
+ instanceId : 'xmp:iid:52cc660c-8de9-472e-9441-810749fc4514' ,
168
+ provenance : null ,
169
+ hash : null ,
170
+ isParent : true ,
171
+ validationStatus : [ ] ,
172
+ metadata : null ,
173
+ manifest : null ,
174
+ thumbnail : {
175
+ blob : { } ,
176
+ contentType : 'image/jpeg' ,
177
+ } ,
178
+ } ,
179
+ ] ,
180
+ redactions : [ ] ,
181
+ parent : null ,
182
+ thumbnail : null ,
183
+ assertions : {
184
+ data : [
185
+ {
186
+ label : 'c2pa.actions' ,
187
+ data : {
188
+ actions : [
189
+ {
190
+ action : 'c2pa.opened' ,
191
+ parameters : {
192
+ 'com.adobe.details' : 'the-other-model-name' ,
193
+ 'com.adobe.digitalSourceType' :
194
+ 'http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia' ,
195
+ ingredient : {
196
+ url : 'self#jumbf=c2pa.assertions/c2pa.ingredient' ,
197
+ hash : [ 1 , 2 , 3 ] ,
198
+ } ,
199
+ 'com.adobe.type' : 'remoteProvider.3rdParty' ,
200
+ } ,
201
+ } ,
202
+ ] ,
203
+ } ,
204
+ } ,
205
+ ] ,
206
+ } ,
207
+ verifiedIdentities : [ ] ,
208
+ } ;
209
+
210
+ expect ( manifest ) . not . toBeNull ( ) ;
211
+ if ( manifest ) {
212
+ const genAssertions = selectGenerativeInfo ( manifest ) ;
213
+ const expectedResult = [
214
+ {
215
+ assertion : {
216
+ label : 'c2pa.actions' ,
217
+ data : {
218
+ actions : [
219
+ {
220
+ action : 'c2pa.opened' ,
221
+ parameters : {
222
+ 'com.adobe.details' : 'the-other-model-name' ,
223
+ 'com.adobe.digitalSourceType' :
224
+ 'http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia' ,
225
+ ingredient : {
226
+ url : 'self#jumbf=c2pa.assertions/c2pa.ingredient' ,
227
+ hash : [ 1 , 2 , 3 ] ,
228
+ } ,
229
+ 'com.adobe.type' : 'remoteProvider.3rdParty' ,
230
+ } ,
231
+ } ,
232
+ ] ,
233
+ } ,
234
+ } ,
235
+ action : {
236
+ action : 'c2pa.opened' ,
237
+ parameters : {
238
+ 'com.adobe.details' : 'the-other-model-name' ,
239
+ 'com.adobe.digitalSourceType' :
240
+ 'http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia' ,
241
+ ingredient : {
242
+ url : 'self#jumbf=c2pa.assertions/c2pa.ingredient' ,
243
+ hash : [ 1 , 2 , 3 ] ,
244
+ } ,
245
+ 'com.adobe.type' : 'remoteProvider.3rdParty' ,
246
+ } ,
247
+ } ,
248
+ type : 'trainedAlgorithmicMedia' ,
249
+ softwareAgent : {
250
+ name : 'the-other-model-name' ,
251
+ } ,
252
+ } ,
253
+ ] ;
254
+ expect ( genAssertions ) . toEqual ( expectedResult ) ;
255
+ }
256
+ } ) ;
143
257
} ) ;
144
258
} ) ;
0 commit comments