mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-21 04:59:15 +00:00
fix(cli): ⚡ working flowDynamic test
This commit is contained in:
@@ -82,8 +82,7 @@ test(`[Caso - 07] Retornar estado`, async () => {
|
|||||||
assert.is('Tu datos son:', getHistory[6])
|
assert.is('Tu datos son:', getHistory[6])
|
||||||
assert.is('Nombre: Leifer Edad: 90', getHistory[7])
|
assert.is('Nombre: Leifer Edad: 90', getHistory[7])
|
||||||
assert.is('🤖🤖 Gracias por tu participacion', getHistory[8])
|
assert.is('🤖🤖 Gracias por tu participacion', getHistory[8])
|
||||||
assert.is('🤖🤖 Gracias por tu participacion', getHistory[9])
|
assert.is(undefined, getHistory[9])
|
||||||
assert.is(undefined, getHistory[10])
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test.run()
|
test.run()
|
||||||
|
|||||||
@@ -172,10 +172,11 @@ class CoreClass {
|
|||||||
for (const msg of parseListMsg) {
|
for (const msg of parseListMsg) {
|
||||||
await this.sendProviderAndSave(from, msg)
|
await this.sendProviderAndSave(from, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
const nextFlow = await this.flowClass.find(refToContinue?.ref, true)
|
const nextFlow = await this.flowClass.find(refToContinue?.ref, true)
|
||||||
const filterNextFlow = nextFlow.filter((msg) => msg.refSerialize !== currentPrev?.refSerialize)
|
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 })
|
return sendFlow(filterNextFlow, from, { prev: undefined })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user