File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1081,5 +1081,26 @@ describe('Validation.vue - Business Logic', () => {
10811081 expect ( wrapper . vm . document ) . toBe ( null )
10821082 expect ( wrapper . vm . validationErrorMessage ) . toBe ( 'Failed to validate document' )
10831083 } )
1084+
1085+ it ( 'normalizes missing optional fields to internal defaults' , ( ) => {
1086+ const payload = createLoadedValidationDocument ( )
1087+ delete ( payload as Record < string , unknown > ) . signers
1088+ delete ( payload as Record < string , unknown > ) . metadata
1089+ delete ( payload as Record < string , unknown > ) . settings
1090+
1091+ wrapper . vm . handleValidationSuccess ( payload )
1092+
1093+ expect ( wrapper . vm . document ) . not . toBe ( null )
1094+ expect ( wrapper . vm . document . signers ) . toEqual ( [ ] )
1095+ expect ( wrapper . vm . document . metadata ) . toEqual ( { extension : 'pdf' , p : 1 } )
1096+ expect ( wrapper . vm . document . settings ) . toEqual ( expect . objectContaining ( {
1097+ canSign : false ,
1098+ canRequestSign : false ,
1099+ phoneNumber : '' ,
1100+ hasSignatureFile : false ,
1101+ needIdentificationDocuments : false ,
1102+ identificationDocumentsWaitingApproval : false ,
1103+ } ) )
1104+ } )
10841105 } )
10851106} )
You can’t perform that action at this time.
0 commit comments