aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-10-08 16:49:03 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-10-08 16:49:03 +0300
commit541a71c3a561e74d273c0b210bde70f4e0b31681 (patch)
tree5a06decc988fb422c0431b4df270939d204fcc00 /test
parenta26d55013779d7b41e4a4aa0dc2477a6926116ae (diff)
parent122323f35c32a4f12a345a8b3f163e9318f5dea3 (diff)
Merge branch 'develop' into feature/following_reblogs
Diffstat (limited to 'test')
-rw-r--r--test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js15
1 files changed, 14 insertions, 1 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 20e03cb0..49f378e2 100644
--- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
+++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
@@ -278,10 +278,12 @@ describe('API Entities normalizer', () => {
})
it('adds hide_follows and hide_followers user settings', () => {
- const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false } })
+ const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false, hide_followers_count: false, hide_follows_count: true } })
expect(parseUser(user)).to.have.property('hide_followers', true)
expect(parseUser(user)).to.have.property('hide_follows', false)
+ expect(parseUser(user)).to.have.property('hide_followers_count', false)
+ expect(parseUser(user)).to.have.property('hide_follows_count', true)
})
})
@@ -343,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] {|}*\'')
+ })
})
})