Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider eb8a36cb rédigé par Will Hunt's avatar Will Hunt Validation de GitHub
Parcourir les fichiers

Merge pull request #160 from Half-Shot/hs/mention-url-tests

Test to ensure URLs are not manged by mentions
parents a115e329 88355cb4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -262,6 +262,14 @@ describe("MatrixEventProcessor", () => { ...@@ -262,6 +262,14 @@ describe("MatrixEventProcessor", () => {
processor.FindMentionsInPlainBody("Hello TestUsername#54321", members), processor.FindMentionsInPlainBody("Hello TestUsername#54321", members),
"Hello <@!12345>", "Hello <@!12345>",
); );
Chai.assert.equal(
processor.FindMentionsInPlainBody("I really love going to https://TestUsername.com", members),
"I really love going to https://TestUsername.com",
);
Chai.assert.equal(
processor.FindMentionsInPlainBody("I really love going to www.TestUsername.com", members),
"I really love going to www.TestUsername.com",
);
}); });
it("processes mentioned nickname correctly", async () => { it("processes mentioned nickname correctly", async () => {
const processor = createMatrixEventProcessor(); const processor = createMatrixEventProcessor();
...@@ -310,6 +318,14 @@ describe("MatrixEventProcessor", () => { ...@@ -310,6 +318,14 @@ describe("MatrixEventProcessor", () => {
processor.FindMentionsInPlainBody("Fixing this issue provided by @Test", members), processor.FindMentionsInPlainBody("Fixing this issue provided by @Test", members),
"Fixing this issue provided by <@!54321>", "Fixing this issue provided by <@!54321>",
); );
Chai.assert.equal(
processor.FindMentionsInPlainBody("I really love going to https://Test.com", members),
"I really love going to https://Test.com",
);
Chai.assert.equal(
processor.FindMentionsInPlainBody("I really love going to www.Test.com", members),
"I really love going to www.Test.com",
);
}); });
it("processes non-mentions correctly", async () => { it("processes non-mentions correctly", async () => {
const processor = createMatrixEventProcessor(); const processor = createMatrixEventProcessor();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter