aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-09-30 23:45:03 +0300
committerHenry Jameson <me@hjkos.com>2019-09-30 23:45:03 +0300
commita2923570c369e537ef1757865f708f73f20f3a16 (patch)
treeb67686426496878f7e34d64a208ffa930fb32f11 /test/unit
parentaadd36f3ec2d5131deae43a4e8042455a90ca16f (diff)
fix regex shortcode problem
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
index 736b842c..49f378e2 100644
--- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
+++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
@@ -345,5 +345,16 @@ describe('API Entities normalizer', () => {
const result = addEmojis('Admin add the :tenshi: emoji', emojis)
expect(result).to.equal('Admin add the :tenshi: emoji')
})
+
+ it('Doesn\'t blow up on regex special characters', () => {
+ const emojis = makeMockEmojiMasto([{
+ shortcode: 'c++'
+ }, {
+ shortcode: '[a-z] {|}*'
+ }])
+ const result = addEmojis('This post has :c++: emoji and :[a-z] {|}*: emoji', emojis)
+ expect(result).to.include('title=\'c++\'')
+ expect(result).to.include('title=\'[a-z] {|}*\'')
+ })
})
})