@@ -13,8 +13,8 @@ import Validation from '../../views/Validation.vue'
1313// Mock async components to prevent defineAsyncComponent from triggering
1414// pending Vite dev-server fetches that outlive the worker and cause
1515// "Closing rpc while fetch was pending" errors in Vitest.
16- vi . mock ( '../../components/validation/EnvelopeValidation.vue' , ( ) => ( { default : { template : '<div />' } } ) )
17- vi . mock ( '../../components/validation/FileValidation.vue' , ( ) => ( { default : { template : '<div />' } } ) )
16+ vi . mock ( '../../components/validation/EnvelopeValidation.vue' , ( ) => ( { default : { template : '<div data-test="envelope-validation" />' } } ) )
17+ vi . mock ( '../../components/validation/FileValidation.vue' , ( ) => ( { default : { template : '<div data-test="file-validation" />' } } ) )
1818vi . mock ( '../../components/validation/SigningProgress.vue' , ( ) => ( { default : { template : '<div />' } } ) )
1919
2020// Mock js-confetti
@@ -282,6 +282,20 @@ describe('Validation.vue - Business Logic', () => {
282282
283283 expect ( wrapper . html ( ) ) . not . toContain ( '[object Promise]' )
284284 } )
285+
286+ it ( 'uses component references instead of string names for validation content' , async ( ) => {
287+ wrapper . vm . document = { uuid : 'doc-uuid' , nodeType : 'file' , name : 'contract.pdf' }
288+ await wrapper . vm . $nextTick ( )
289+
290+ expect ( typeof wrapper . vm . validationComponent ) . toBe ( 'object' )
291+ expect ( wrapper . vm . validationComponent ) . not . toBe ( 'FileValidation' )
292+
293+ wrapper . vm . document = { uuid : 'doc-uuid' , nodeType : 'envelope' , name : 'envelope' , files : [ { id : 1 } ] }
294+ await wrapper . vm . $nextTick ( )
295+
296+ expect ( typeof wrapper . vm . validationComponent ) . toBe ( 'object' )
297+ expect ( wrapper . vm . validationComponent ) . not . toBe ( 'EnvelopeValidation' )
298+ } )
285299 } )
286300
287301 describe ( 'getValidityStatus method' , ( ) => {
0 commit comments