summaryrefslogtreecommitdiffstats
path: root/webapp/tests/utils
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-05-01 17:40:54 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-05-01 17:40:54 -0400
commit581bd8637fa860fa26f60d8089c5d6e3f613d23f (patch)
treeb0ba799af7f873b460e45f5e6057b357be0e8047 /webapp/tests/utils
parent935405f19d4a0d78f1a84964460635ec5a091e0c (diff)
downloadchat-581bd8637fa860fa26f60d8089c5d6e3f613d23f.tar.gz
chat-581bd8637fa860fa26f60d8089c5d6e3f613d23f.tar.bz2
chat-581bd8637fa860fa26f60d8089c5d6e3f613d23f.zip
Revert "[GH-5915] Clicking on @mention of a user in a post shows the profile popover (#6129)" (#6289)
This reverts commit 83f819451a80a767170b927eb2f0d5ed63f03239.
Diffstat (limited to 'webapp/tests/utils')
-rw-r--r--webapp/tests/utils/formatting_at_mentions.test.jsx30
-rw-r--r--webapp/tests/utils/formatting_hashtags.test.jsx2
2 files changed, 12 insertions, 20 deletions
diff --git a/webapp/tests/utils/formatting_at_mentions.test.jsx b/webapp/tests/utils/formatting_at_mentions.test.jsx
index 51f9bef65..d64b42c3f 100644
--- a/webapp/tests/utils/formatting_at_mentions.test.jsx
+++ b/webapp/tests/utils/formatting_at_mentions.test.jsx
@@ -50,38 +50,30 @@ describe('TextFormatting.AtMentions', function() {
);
});
- it('Not at mentions', function() {
- assert.equal(
- TextFormatting.autolinkAtMentions('user@host', new Map(), {user: {}, host: {}}),
- 'user@host'
- );
-
- assert.equal(
- TextFormatting.autolinkAtMentions('user@email.com', new Map(), {user: {}, email: {}}),
- 'user@email.com'
- );
-
+ it('Implied at mentions', function() {
+ // PLT-4454 Assume users exist for things that look like at mentions until we support the new mention syntax
assert.equal(
TextFormatting.autolinkAtMentions('@user', new Map(), {}),
- '@user'
+ '$MM_ATMENTION0',
+ 'should imply user exists and replace mention with token'
);
assert.equal(
TextFormatting.autolinkAtMentions('@user.', new Map(), {}),
- '@user.',
+ '$MM_ATMENTION0.',
'should assume username doesn\'t end in punctuation'
);
+ });
+ it('Not at mentions', function() {
assert.equal(
- TextFormatting.autolinkAtMentions('@will', new Map(), {william: {}}),
- '@will',
- 'should return same text without token'
+ TextFormatting.autolinkAtMentions('user@host', new Map(), {user: {}, host: {}}),
+ 'user@host'
);
assert.equal(
- TextFormatting.autolinkAtMentions('@william', new Map(), {will: {}}),
- '@william',
- 'should return same text without token'
+ TextFormatting.autolinkAtMentions('user@email.com', new Map(), {user: {}, email: {}}),
+ 'user@email.com'
);
});
});
diff --git a/webapp/tests/utils/formatting_hashtags.test.jsx b/webapp/tests/utils/formatting_hashtags.test.jsx
index 0aadd6626..1740a8ce7 100644
--- a/webapp/tests/utils/formatting_hashtags.test.jsx
+++ b/webapp/tests/utils/formatting_hashtags.test.jsx
@@ -166,7 +166,7 @@ describe('TextFormatting.Hashtags', function() {
};
assert.equal(
TextFormatting.formatText('#@test', options).trim(),
- "<p>#<span data-mention='test'><a class='mention-link' href='#'>@test</a></span></p>"
+ "<p>#<a class='mention-link' href='#' data-mention='test'>@test</a></p>"
);
assert.equal(