diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-05-01 23:08:54 +0900 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-05-01 10:08:54 -0400 |
commit | 83f819451a80a767170b927eb2f0d5ed63f03239 (patch) | |
tree | d1a5e0ff5078c12c7c292e6ad9123c0e5bc4fb4e /webapp/tests/utils | |
parent | 597641545d1be04a1ba6c0b2d35c75fc2cfc8737 (diff) | |
download | chat-83f819451a80a767170b927eb2f0d5ed63f03239.tar.gz chat-83f819451a80a767170b927eb2f0d5ed63f03239.tar.bz2 chat-83f819451a80a767170b927eb2f0d5ed63f03239.zip |
[GH-5915] Clicking on @mention of a user in a post shows the profile popover (#6129)
* post message at-mention profile pop-over
* remove hover effect to special mentions
* make non-clickable the non-existing at-mention username
* fix "video call" position
* use usernameMap instead of initially defined liteUsernameMap
* update per comments
Diffstat (limited to 'webapp/tests/utils')
-rw-r--r-- | webapp/tests/utils/formatting_at_mentions.test.jsx | 30 | ||||
-rw-r--r-- | webapp/tests/utils/formatting_hashtags.test.jsx | 2 |
2 files changed, 20 insertions, 12 deletions
diff --git a/webapp/tests/utils/formatting_at_mentions.test.jsx b/webapp/tests/utils/formatting_at_mentions.test.jsx index d64b42c3f..51f9bef65 100644 --- a/webapp/tests/utils/formatting_at_mentions.test.jsx +++ b/webapp/tests/utils/formatting_at_mentions.test.jsx @@ -50,30 +50,38 @@ describe('TextFormatting.AtMentions', function() { ); }); - it('Implied at mentions', function() { - // PLT-4454 Assume users exist for things that look like at mentions until we support the new mention syntax + 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' + ); + assert.equal( TextFormatting.autolinkAtMentions('@user', new Map(), {}), - '$MM_ATMENTION0', - 'should imply user exists and replace mention with token' + '@user' ); assert.equal( TextFormatting.autolinkAtMentions('@user.', new Map(), {}), - '$MM_ATMENTION0.', + '@user.', 'should assume username doesn\'t end in punctuation' ); - }); - it('Not at mentions', function() { assert.equal( - TextFormatting.autolinkAtMentions('user@host', new Map(), {user: {}, host: {}}), - 'user@host' + TextFormatting.autolinkAtMentions('@will', new Map(), {william: {}}), + '@will', + 'should return same text without token' ); assert.equal( - TextFormatting.autolinkAtMentions('user@email.com', new Map(), {user: {}, email: {}}), - 'user@email.com' + TextFormatting.autolinkAtMentions('@william', new Map(), {will: {}}), + '@william', + 'should return same text without token' ); }); }); diff --git a/webapp/tests/utils/formatting_hashtags.test.jsx b/webapp/tests/utils/formatting_hashtags.test.jsx index 1740a8ce7..0aadd6626 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>#<a class='mention-link' href='#' data-mention='test'>@test</a></p>" + "<p>#<span data-mention='test'><a class='mention-link' href='#'>@test</a></span></p>" ); assert.equal( |