microsoftly/BotTester

defaultAddress is not working when passing plain strings to sendMessageToBot function

Closed this issue · 3 comments

  const address = {
        channelId: 'slack',
        user: { id: 'UXXX', name: 'Santiago' },
        bot: { id: 'BXXX', name: 'Suttna' },
        conversation: { id: 'TXXX:CXXX' }
  }

  bot.dialog('/', (session: Session) => {
    bot.send("Bye")
  })

  const message = new Message().address(address).text("Bye").toMessage()

  return new BotTester(bot, { defaultAddress: address })
    .sendMessageToBot("Hello", message)
    .runTest()

In the above scenario, the expectation fails because it doesn't use given address, it uses always this one https://github.com/microsoftly/BotTester/blob/master/src/config.ts#L25.

Here is a hotfix for this issue #25

@microsoftly lemme know if that's ok or if you need more information :)

makes sense to me

#25 fixed, closing