From 2afe07d90e2b081266055a80dd2fbe307c6dab9c Mon Sep 17 00:00:00 2001 From: Half-Shot Date: Tue, 15 Oct 2024 11:13:20 +0100 Subject: [PATCH] Add a test for mjolnir commands with extra spaces --- test/integration/helloTest.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/integration/helloTest.ts b/test/integration/helloTest.ts index 3de2bb24..e2f4b320 100644 --- a/test/integration/helloTest.ts +++ b/test/integration/helloTest.ts @@ -26,4 +26,18 @@ describe("Test: !help command", function() { await client.sendMessage(this.mjolnir.managementRoomId, {msgtype: "m.text", body: "!mjolnir help"}) await reply }) + it('Mjolnir responded to !mjolnir help with extra spaces', async function() { + this.timeout(30000); + // send a messgage + await client.joinRoom(this.config.managementRoom); + // listener for getting the event reply + let reply = new Promise((resolve, reject) => { + client.on('room.message', noticeListener(this.mjolnir.managementRoomId, (event) => { + if (event.content.body.includes("Print status information")) { + resolve(event); + } + }))}); + await client.sendMessage(this.mjolnir.managementRoomId, {msgtype: "m.text", body: " !mjolnir help "}) + await reply + }) })