@ondc/automation-mock-runner 1.3.37 → 1.3.39
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.
package/dist/lib/configHelper.js
CHANGED
|
@@ -229,13 +229,14 @@ async function buildConfigFromFlowConfig(payloads, flowConfig, domain, version,
|
|
|
229
229
|
flowConfig = JSON.parse(JSON.stringify(flowConfig));
|
|
230
230
|
payloads = [...payloads].sort((a, b) => new Date(a.context.timestamp).getTime() -
|
|
231
231
|
new Date(b.context.timestamp).getTime());
|
|
232
|
-
const config = createInitialMockConfig(domain, version, `${flowConfig.id}
|
|
232
|
+
const config = createInitialMockConfig(domain, version, `${flowConfig.id}`);
|
|
233
233
|
const mockRunner = new MockRunner_1.MockRunner(config);
|
|
234
234
|
let index = 0;
|
|
235
235
|
for (const step of flowConfig.sequence) {
|
|
236
236
|
const isFormStep = step.type === "HTML_FORM" ||
|
|
237
237
|
step.type === "DYNAMIC_FORM" ||
|
|
238
|
-
step.type === "FORM"
|
|
238
|
+
step.type === "FORM" ||
|
|
239
|
+
step.type === "HTML_FORM_MULTI";
|
|
239
240
|
let stepConfig;
|
|
240
241
|
if (isFormStep) {
|
|
241
242
|
// HTML_FORM is not yet fully implemented — fall back to dynamic_form default
|
|
@@ -675,7 +675,7 @@ describe("configHelper", () => {
|
|
|
675
675
|
const config = await (0, configHelper_1.generatePlaygroundConfigFromFlowConfig)(payloads, flowConfig);
|
|
676
676
|
expect(config.meta.domain).toBe("ONDC:TRV14");
|
|
677
677
|
expect(config.meta.version).toBe("1.5.0");
|
|
678
|
-
expect(config.meta.flowId).toBe("
|
|
678
|
+
expect(config.meta.flowId).toBe("sample_flow");
|
|
679
679
|
expect(config.steps).toHaveLength(2);
|
|
680
680
|
const [searchStepConfig, onSearchStepConfig] = config.steps;
|
|
681
681
|
expect(searchStepConfig.api).toBe("search");
|
|
@@ -716,7 +716,7 @@ describe("configHelper", () => {
|
|
|
716
716
|
const config = await (0, configHelper_1.generatePlaygroundConfigFromFlowConfig)(payloads, flowConfig);
|
|
717
717
|
expect(config.meta.domain).toBe("ONDC:FIS12");
|
|
718
718
|
expect(config.meta.version).toBe("1.0.0");
|
|
719
|
-
expect(config.meta.flowId).toBe("
|
|
719
|
+
expect(config.meta.flowId).toBe("core_version_flow");
|
|
720
720
|
});
|
|
721
721
|
it("should handle multiple search requests with different timestamps interspersed with on_search responses", async () => {
|
|
722
722
|
const payloads = [
|