From 0cade8dc03f882a78acc8a92f5e860f6f6343ba5 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 15 Mar 2022 13:18:48 +0000 Subject: [PATCH] switch to room.event emit --- test/integration/standardConsequenceTest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/standardConsequenceTest.ts b/test/integration/standardConsequenceTest.ts index 7070b55..68048fd 100644 --- a/test/integration/standardConsequenceTest.ts +++ b/test/integration/standardConsequenceTest.ts @@ -131,7 +131,6 @@ describe("Test: standard consequences", function() { }); await this.mjolnir.enableProtection("95B1Cr"); - await goodUser.sendMessage(protectedRoomId, {msgtype: "m.text", body: "SUwvFT"}); let reply = new Promise(async (resolve, reject) => { this.mjolnir.client.on('room.message', async (roomId, event) => { if (event?.content?.body === "SUwvFT") { @@ -139,7 +138,7 @@ describe("Test: standard consequences", function() { } }); - badUser.on('room.leave', (roomId, event) => { + this.mjolnir.client.on('room.event', (roomId, event) => { if ( roomId === protectedRoomId && event?.type === "m.room.member" @@ -153,6 +152,7 @@ describe("Test: standard consequences", function() { } }); }); + await goodUser.sendMessage(protectedRoomId, {msgtype: "m.text", body: "SUwvFT"}); await reply });