Skip to content

Commit

Permalink
feat: ⚡ lot improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
leifermendez committed Oct 16, 2023
1 parent 21a0730 commit 2a1726b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/bot/tests/bot.class.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,33 @@ test(`[Bot] Probando gotoFlow `, async () => {
assert.is(Object.values(result).length, 0)
})

test(`[Bot] Probando flowDynamic `, async () => {
const mockProvider = new MockProvider()
const flowWelcome = addKeyword('hola').addAnswer('chao')
const flow = createFlow([flowWelcome])
const setting = {
flow,
database: new MockDBB(),
provider: mockProvider,
}

const bot = await createBot(setting)

const messageCtxInComming = {
body: 'Hola',
from: '123456789',
}

const botHandler = await bot.handleMsg(messageCtxInComming)
const result = botHandler.flowDynamic([
{
body: 'Message',
},
])(flowWelcome)

assert.is(Object.values(result).length, 0)
})

test.run()

function delay(ms) {
Expand Down

0 comments on commit 2a1726b

Please sign in to comment.