aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/specs')
-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] {|}*\'')
+ })
})
})