File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -558,4 +558,32 @@ describe('Event', () => {
558558 expect ( fn3 ) . not . toHaveBeenCalled ( ) ;
559559 expect ( next ) . toEqual ( createFormHub ( ) . forms . multi ) ;
560560 } ) ;
561+
562+ it ( 'entrypoint other than a string' , async ( ) => {
563+ const producer = FormEventProducer . fromFormHub ( {
564+ entrypoint : {
565+ form : 'test' ,
566+ initialArgs : {
567+ myVal : 4 ,
568+ } ,
569+ } ,
570+ forms : {
571+ test : {
572+ type : 'multi-button' ,
573+ title : 'myVal is: {myVal}' ,
574+ elements : [ ] ,
575+ } ,
576+ } ,
577+ } ) ;
578+
579+ const next = await triggerEvent ( producer , { } ) ;
580+
581+ expect ( next ) . toEqual ( {
582+ type : 'multi-button' ,
583+ title : 'myVal is: {myVal}' ,
584+ elements : [ ] ,
585+ } ) ;
586+
587+ expect ( producer . args . resolveTemplate ( 'myVal is: {myVal}' ) ) . toBe ( 'myVal is: 4' ) ;
588+ } ) ;
561589} ) ;
You can’t perform that action at this time.
0 commit comments