@@ -48,25 +48,29 @@ function setup() {
4848
4949function mockEvent (
5050 hasTestData : boolean ,
51- personalisationFields : string [ ]
51+ personalisationParameters : string [ ]
5252) : ProofingRequest {
5353 return {
5454 owner,
5555 templateId,
5656 pdfVersion,
5757 ...( hasTestData && { testDataVersion } ) ,
58- personalisationFields ,
58+ personalisationParameters ,
5959 } ;
6060}
6161
6262describe ( 'App' , ( ) => {
6363 test ( 'calls dependencies to send a proofing request' , async ( ) => {
6464 const { app, mocks } = setup ( ) ;
6565
66- const personalisationFields = [ 'pdsField' , 'custom1' , 'custom2' ] ;
67- const batchColumns = [ 'clientRef' , 'template' , ...personalisationFields ] ;
66+ const personalisationParameters = [ 'pdsField' , 'custom1' , 'custom2' ] ;
67+ const batchColumns = [
68+ 'clientRef' ,
69+ 'template' ,
70+ ...personalisationParameters ,
71+ ] ;
6872
69- const event = mockEvent ( true , personalisationFields ) ;
73+ const event = mockEvent ( true , personalisationParameters ) ;
7074
7175 const pdfContent = 'mock PDF content' ;
7276 const pdf = Readable . from ( pdfContent ) ;
@@ -172,13 +176,13 @@ describe('App', () => {
172176 expect ( mocks . syntheticBatch . buildBatch ) . toHaveBeenCalledTimes ( 1 ) ;
173177 expect ( mocks . syntheticBatch . buildBatch ) . toHaveBeenCalledWith (
174178 templateId ,
175- personalisationFields ,
179+ personalisationParameters ,
176180 testData
177181 ) ;
178182
179183 expect ( mocks . syntheticBatch . getHeader ) . toHaveBeenCalledTimes ( 1 ) ;
180184 expect ( mocks . syntheticBatch . getHeader ) . toHaveBeenCalledWith (
181- personalisationFields
185+ personalisationParameters
182186 ) ;
183187
184188 expect ( mocks . syntheticBatch . buildManifest ) . toHaveBeenCalledTimes ( 1 ) ;
@@ -253,7 +257,7 @@ describe('App', () => {
253257 test ( 'throws if proof request event is missing a property' , async ( ) => {
254258 const { app, mocks } = setup ( ) ;
255259
256- const { personalisationFields : _ , ...invalidEvent } = mockEvent ( true , [
260+ const { personalisationParameters : _ , ...invalidEvent } = mockEvent ( true , [
257261 'field' ,
258262 ] ) ;
259263
@@ -270,10 +274,14 @@ describe('App', () => {
270274 test ( 'exits early and does not send if a lock is already in effect' , async ( ) => {
271275 const { app, mocks, logMessages } = setup ( ) ;
272276
273- const personalisationFields = [ 'pdsField' ] ;
274- const batchColumns = [ 'clientRef' , 'template' , ...personalisationFields ] ;
277+ const personalisationParameters = [ 'pdsField' ] ;
278+ const batchColumns = [
279+ 'clientRef' ,
280+ 'template' ,
281+ ...personalisationParameters ,
282+ ] ;
275283
276- const event = mockEvent ( true , personalisationFields ) ;
284+ const event = mockEvent ( true , personalisationParameters ) ;
277285
278286 const pdfContent = 'mock PDF content' ;
279287 const pdf = Readable . from ( pdfContent ) ;
@@ -353,10 +361,14 @@ describe('App', () => {
353361 test ( 'exits early and does not send if the manifest is already in the SFTP server, clears existing lock' , async ( ) => {
354362 const { app, mocks, logMessages } = setup ( ) ;
355363
356- const personalisationFields = [ 'pdsField' ] ;
357- const batchColumns = [ 'clientRef' , 'template' , ...personalisationFields ] ;
364+ const personalisationParameters = [ 'pdsField' ] ;
365+ const batchColumns = [
366+ 'clientRef' ,
367+ 'template' ,
368+ ...personalisationParameters ,
369+ ] ;
358370
359- const event = mockEvent ( true , personalisationFields ) ;
371+ const event = mockEvent ( true , personalisationParameters ) ;
360372
361373 const pdfContent = 'mock PDF content' ;
362374 const pdf = Readable . from ( pdfContent ) ;
@@ -443,9 +455,9 @@ describe('App', () => {
443455 test ( 'logs handled errors' , async ( ) => {
444456 const { app, mocks, logMessages } = setup ( ) ;
445457
446- const personalisationFields = [ 'pdsField' , 'custom1' , 'custom2' ] ;
458+ const personalisationParameters = [ 'pdsField' , 'custom1' , 'custom2' ] ;
447459
448- const event = mockEvent ( true , personalisationFields ) ;
460+ const event = mockEvent ( true , personalisationParameters ) ;
449461
450462 const batchId = 'template-id-0000000000000_pdfversionid' ;
451463
0 commit comments