fix(cli): working flowDynamic test

This commit is contained in:
Leifer Jesús Mendez
2023-02-03 19:26:00 +01:00
parent f76932021c
commit aef52d2694
2 changed files with 4 additions and 4 deletions

View File

@@ -82,8 +82,7 @@ test(`[Caso - 07] Retornar estado`, async () => {
assert.is('Tu datos son:', getHistory[6])
assert.is('Nombre: Leifer Edad: 90', getHistory[7])
assert.is('🤖🤖 Gracias por tu participacion', getHistory[8])
assert.is('🤖🤖 Gracias por tu participacion', getHistory[9])
assert.is(undefined, getHistory[10])
assert.is(undefined, getHistory[9])
})
test.run()

View File

@@ -172,10 +172,11 @@ class CoreClass {
for (const msg of parseListMsg) {
await this.sendProviderAndSave(from, msg)
}
const nextFlow = await this.flowClass.find(refToContinue?.ref, true)
const filterNextFlow = nextFlow.filter((msg) => msg.refSerialize !== currentPrev?.refSerialize)
console.log(`🚩🚩🚩`, filterNextFlow?.answer)
if (filterNextFlow.map((i) => i.keyword).includes(currentPrev?.ref)) return
return sendFlow(filterNextFlow, from, { prev: undefined })
}