@@ -482,6 +482,58 @@ describe('SHAREPOINT_STORE_FILES', () => {
482
482
} )
483
483
} )
484
484
485
+ describe ( 'CIVIC_REC_COMPLETE_CHECKOUT' , ( ) => {
486
+ const validSubmissionEvent = {
487
+ type : 'CIVIC_REC_COMPLETE_CHECKOUT' ,
488
+ configuration : { } ,
489
+ }
490
+ it ( 'should allow empty object as the configuration' , ( ) => {
491
+ const form = validateFormThrowError ( {
492
+ ...defaultForm ,
493
+ submissionEvents : [ validSubmissionEvent ] ,
494
+ } )
495
+
496
+ expect ( form . submissionEvents [ 0 ] ) . toEqual ( {
497
+ ...validSubmissionEvent ,
498
+ conditionallyExecute : false ,
499
+ requiresAllConditionallyExecutePredicates : false ,
500
+ configuration : { } ,
501
+ } )
502
+ } )
503
+
504
+ it ( 'should strip out any additional data in the configuration' , ( ) => {
505
+ const form = validateFormThrowError ( {
506
+ ...defaultForm ,
507
+ submissionEvents : [
508
+ {
509
+ ...validSubmissionEvent ,
510
+ configuration : { fakeVariable : "I'm fake!" } ,
511
+ } ,
512
+ ] ,
513
+ } )
514
+
515
+ expect ( form . submissionEvents [ 0 ] ) . toEqual ( {
516
+ ...validSubmissionEvent ,
517
+ conditionallyExecute : false ,
518
+ requiresAllConditionallyExecutePredicates : false ,
519
+ configuration : { } ,
520
+ } )
521
+ } )
522
+
523
+ it ( 'should fail without empty configuration on the submission event' , ( ) => {
524
+ expect ( ( ) =>
525
+ validateFormThrowError ( {
526
+ ...defaultForm ,
527
+ submissionEvents : [
528
+ {
529
+ type : 'CIVIC_REC_COMPLETE_CHECKOUT' ,
530
+ } ,
531
+ ] ,
532
+ } ) ,
533
+ ) . toThrow ( '"submissionEvents[0].configuration" is required' )
534
+ } )
535
+ } )
536
+
485
537
describe ( 'PDF configuration' , ( ) => {
486
538
const submissionEvent = {
487
539
type : 'PDF' ,
0 commit comments