summaryrefslogtreecommitdiffstats
path: root/webapp/tests
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-09-05 12:39:07 -0400
committerSaturnino Abril <saturnino.abril@gmail.com>2017-09-06 00:39:07 +0800
commit575864c917dbbe6b58d3e4534c3015327f2cb088 (patch)
tree547ecd46393b82961e4e5518d47273d8bb4ed2f6 /webapp/tests
parentdaed8ffbf6151f01866b9299574fdf6764c8b7bd (diff)
downloadchat-575864c917dbbe6b58d3e4534c3015327f2cb088.tar.gz
chat-575864c917dbbe6b58d3e4534c3015327f2cb088.tar.bz2
chat-575864c917dbbe6b58d3e4534c3015327f2cb088.zip
PLT-7474 Stopped requiring confirmation for mentions in code blocks (#7375)
* PLT-7474 Stopped requiring confirmation for mentions in code blocks * Stopped mentioning people from code blocks using ~~~
Diffstat (limited to 'webapp/tests')
-rw-r--r--webapp/tests/utils/post_utils.test.jsx54
1 files changed, 52 insertions, 2 deletions
diff --git a/webapp/tests/utils/post_utils.test.jsx b/webapp/tests/utils/post_utils.test.jsx
index 0546d5bea..bcb5c039e 100644
--- a/webapp/tests/utils/post_utils.test.jsx
+++ b/webapp/tests/utils/post_utils.test.jsx
@@ -4,8 +4,8 @@ describe('PostUtils.containsAtMention', function() {
test('should return correct @all (same for @channel)', function() {
for (const data of [
{
- text: undefined, //eslint-disable-line no-undefined
- key: undefined, //eslint-disable-line no-undefined
+ text: undefined, // eslint-disable-line no-undefined
+ key: undefined, // eslint-disable-line no-undefined
result: false
},
{
@@ -87,6 +87,56 @@ describe('PostUtils.containsAtMention', function() {
text: 'hey @ALL:+1:',
key: '@all',
result: true
+ },
+ {
+ text: '`@all`',
+ key: '@all',
+ result: false
+ },
+ {
+ text: '@someone `@all`',
+ key: '@all',
+ result: false
+ },
+ {
+ text: '@someone `@all`',
+ key: '@someone',
+ result: true
+ },
+ {
+ text: '``@all``',
+ key: '@all',
+ result: false
+ },
+ {
+ text: '```@all```',
+ key: '@all',
+ result: false
+ },
+ {
+ text: '```\n@all\n```',
+ key: '@all',
+ result: false
+ },
+ {
+ text: '```````\n@all\n```````',
+ key: '@all',
+ result: false
+ },
+ {
+ text: '```code\n@all\n```',
+ key: '@all',
+ result: false
+ },
+ {
+ text: '~~~@all~~~',
+ key: '@all',
+ result: true
+ },
+ {
+ text: '~~~\n@all\n~~~',
+ key: '@all',
+ result: false
}
]) {
const containsAtMention = PostUtils.containsAtMention(data.text, data.key);