@@ -141,59 +141,7 @@ describe("_onFormSubmission", () => {
141141 } ,
142142 name : { value : "Test Name" , response : "Test Name" } ,
143143 } ,
144- form : {
145- ...mockForm ,
146- fields : mockForm . fields . map ( ( field ) => ( {
147- type : field . type ,
148- identifier : field . identifier ,
149- } ) ) ,
150- } ,
151- } ) ;
152- } ) ;
153- } ) ;
154-
155- describe ( "Workflows" , ( ) => {
156- it ( "should call WorkflowService.scheduleFormWorkflows for FORM_SUBMITTED workflows" , async ( ) => {
157- const mockWorkflows = [
158- {
159- id : 1 ,
160- name : "Form Submitted Workflow" ,
161- userId : 1 ,
162- teamId : null ,
163- trigger : WorkflowTriggerEvents . FORM_SUBMITTED ,
164- time : null ,
165- timeUnit : null ,
166- steps : [
167- {
168- id : 1 ,
169- action : WorkflowActions . EMAIL_ATTENDEE ,
170- sendTo : null ,
171- reminderBody : "Thank you for your submission!" ,
172- emailSubject : "Form Received" ,
173- template : WorkflowTemplates . CUSTOM ,
174- verifiedAt : new Date ( ) ,
175- includeCalendarEvent : false ,
176- numberVerificationPending : false ,
177- numberRequired : false ,
178- } ,
179- ] ,
180- } ,
181- ] ;
182-
183- vi . mocked ( WorkflowService . getAllWorkflowsFromRoutingForm ) . mockResolvedValueOnce ( mockWorkflows as any ) ;
184-
185- await _onFormSubmission ( mockForm as any , mockResponse , responseId ) ;
186-
187- expect ( WorkflowService . getAllWorkflowsFromRoutingForm ) . toHaveBeenCalledWith ( mockForm ) ;
188- expect ( WorkflowService . scheduleFormWorkflows ) . toHaveBeenCalledWith ( {
189- workflows : mockWorkflows ,
190- responses : {
191- email : {
192- value : "test@response.com" ,
193- response : "test@response.com" ,
194- } ,
195- name : { value : "Test Name" , response : "Test Name" } ,
196- } ,
144+ responseId,
197145 form : {
198146 ...mockForm ,
199147 fields : mockForm . fields . map ( ( field ) => ( {
0 commit comments