From a55486f8d78161166e84b2b69709a49b3845c14e Mon Sep 17 00:00:00 2001 From: kPherox Date: Tue, 19 Nov 2019 14:15:41 +0000 Subject: Normalize profile fields --- .../services/entity_normalizer/entity_normalizer.spec.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/unit/specs/services/entity_normalizer') 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 49f378e2..cfb380ba 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -277,6 +277,19 @@ describe('API Entities normalizer', () => { expect(parsedUser).to.have.property('description_html').that.contains(' { + const user = makeMockUserMasto({ emojis: makeMockEmojiMasto(), fields: [{ name: ':thinking:', value: ':image:' }] }) + + const parsedUser = parseUser(user) + + expect(parsedUser).to.have.property('fields_html').to.be.an('array') + + const field = parsedUser.fields_html[0] + + expect(field).to.have.property('name').that.contains(' { const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false, hide_followers_count: false, hide_follows_count: true } }) -- cgit v1.2.3-70-g09d2 From c2dfe1f6cc364175d5aa17d587f82bdb6b8b189c Mon Sep 17 00:00:00 2001 From: lain Date: Thu, 4 Jun 2020 15:25:00 +0200 Subject: EntityNormalizerSpec: Test new behavior. --- test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/unit/specs/services/entity_normalizer') 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 cfb380ba..178e75c6 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -338,9 +338,9 @@ describe('API Entities normalizer', () => { describe('MastoAPI emoji adder', () => { const emojis = makeMockEmojiMasto() - const imageHtml = 'image' + const imageHtml = ':image:' .replace(/"/g, '\'') - const thinkHtml = 'thinking' + const thinkHtml = ':thinking:' .replace(/"/g, '\'') it('correctly replaces shortcodes in supplied string', () => { -- cgit v1.2.3-70-g09d2 From 05167f202fbb55d1cee1a1c36b630c18ab297419 Mon Sep 17 00:00:00 2001 From: lain Date: Thu, 4 Jun 2020 15:31:52 +0200 Subject: EntityNormalizerSpec: More fixes. --- test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/unit/specs/services/entity_normalizer') 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 178e75c6..166fce2b 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -366,8 +366,8 @@ describe('API Entities normalizer', () => { 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] {|}*\'') + expect(result).to.include('title=\':c++:\'') + expect(result).to.include('title=\':[a-z] {|}*:\'') }) }) }) -- cgit v1.2.3-70-g09d2