Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
H-Shay committed Oct 7, 2024
1 parent 692cd94 commit dd56e45
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/integration/mentionSpamProtectionTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,17 @@ describe("Test: Mention spam protection", function () {

const fetchedDisplaynameEvent = await client.getEvent(room, messageWithDisplaynameMentions);
assert.equal(Object.keys(fetchedDisplaynameEvent.content).length, 0, "This event should have been redacted");

// send messages after activating protection, they should be auto-redacted
const messages = [];
for (let i = 0; i < 10; i++) {
let nextMessage = await client.sendText(room, `hello${i}`);
messages.push(nextMessage)
}

messages.forEach(async (eventID) => {
await client.getEvent(room, eventID);
assert.equal(Object.keys(fetchedDisplaynameEvent.content).length, 0, "This event should have been redacted");
})
});
});

0 comments on commit dd56e45

Please sign in to comment.