@ondc/automation-mock-runner 1.3.40 → 1.3.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,6 +101,14 @@ function convertToFlowConfig(config) {
101
101
  const pair = config.steps.find((s) => s.responseFor === step.action_id)?.action_id ||
102
102
  null;
103
103
  let flowStep = {};
104
+ const isFormStep = ["HTML_FORM", "DYNAMIC_FORM", "HTML_FORM_MULTI"];
105
+ // Check if previous step was a form step
106
+ const previousStep = index > 0 ? config.steps[index - 1] : null;
107
+ const isPreviousStepForm = previousStep !== null && isFormStep.includes(previousStep.api);
108
+ // Check if current step has no inputs
109
+ const hasNoInputs = step.mock.inputs === undefined ||
110
+ step.mock.inputs === null ||
111
+ Object.keys(step.mock.inputs).length === 0;
104
112
  if (step.api === "dynamic_form") {
105
113
  flowStep = {
106
114
  key: step.action_id,
@@ -169,6 +177,10 @@ function convertToFlowConfig(config) {
169
177
  if (step.mock.inputs?.oldInputs) {
170
178
  flowStep.input = step.mock.inputs.oldInputs;
171
179
  }
180
+ // Add force_proceed if previous step was a form and current step has no inputs
181
+ if (isPreviousStepForm && hasNoInputs) {
182
+ flowStep.force_proceed = true;
183
+ }
172
184
  flowConfig.sequence.push(flowStep);
173
185
  index++;
174
186
  }
@@ -0,0 +1 @@
1
+ export {};