Skip to content

Commit

Permalink
Add a test for mjolnir commands with extra spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Oct 15, 2024
1 parent 2a33d84 commit 2afe07d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/integration/helloTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
})

0 comments on commit 2afe07d

Please sign in to comment.