diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-02-20 15:11:52 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-02-20 15:11:52 +0000 |
| commit | 58d0f9678b749d1b2ef8aa7d6fb4a91da9cf947d (patch) | |
| tree | 6879bff1875d70c4eec0bf893e492e76ac0ff562 /test/unit | |
| parent | ddee8bb686fb18baf5212089653a8b4e40feedd6 (diff) | |
| parent | 86e3aefdab3fa1314d4731eabcf03f8c9e418e41 (diff) | |
Merge branch 'fix-mentions-new-bugs' into 'develop'
Fix newfound bugs with rich mentions + user suggestions
See merge request pleroma/pleroma-fe!1430
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/specs/components/rich_content.spec.js | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index f6c478a9..30c66a33 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -350,12 +350,89 @@ describe('RichContent', () => { '<span>', '</span>', '</a>', + '<!---->', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '</span>', + '<!---->', // v-if placeholder, mentionsline's extra mentions and stuff + '</span>' + ), + p( + 'Testing' + ) + ].join('') + + const wrapper = mount(RichContent, { + localVue, + propsData: { + attentions, + handleLinks: true, + greentext: true, + emoji: [], + html + } + }) + + expect(wrapper.html()).to.eql(compwrap(expected)) + }) + + it('rich contents of nested mentions are handled properly', () => { + attentions.push({ statusnet_profile_url: 'lol' }) + const html = [ + p( + '<span class="poast-style">', + '<a href="lol" class="mention">', + '<span>', + 'https://</span>', + '<span>', + 'lol.tld/</span>', + '<span>', + '</span>', + '</a>', ' ', + '<a href="lol" class="mention">', + '<span>', + 'https://</span>', + '<span>', + 'lol.tld/</span>', + '<span>', + '</span>', + '</a>', + '</span>' + ), + p( + 'Testing' + ) + ].join('') + const expected = [ + p( + '<span class="poast-style">', + '<span class="MentionsLine">', + '<span class="MentionLink mention-link">', + '<a href="lol" target="_blank" class="original">', + '<span>', + 'https://</span>', + '<span>', + 'lol.tld/</span>', + '<span>', + '</span>', + '</a>', + '<!---->', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '</span>', + '<span class="MentionLink mention-link">', + '<a href="lol" target="_blank" class="original">', + '<span>', + 'https://</span>', + '<span>', + 'lol.tld/</span>', + '<span>', + '</span>', + '</a>', '<!---->', // v-if placeholder, mentionlink's "new" (i.e. rich) display '</span>', '<!---->', // v-if placeholder, mentionsline's extra mentions and stuff + '</span>', '</span>' ), + ' ', p( 'Testing' ) |
