Skip to content

Commit

Permalink
fix(cli): ⚡ working flowDynamic test
Browse files Browse the repository at this point in the history
  • Loading branch information
Leifer Jesús Mendez committed Feb 3, 2023
1 parent f769320 commit aef52d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions __test__/07-case.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions packages/bot/core/core.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

Expand Down

0 comments on commit aef52d2

Please sign in to comment.