diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index 8a29bd6e..30c66a33 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -374,6 +374,84 @@ describe('RichContent', () => { 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( + '', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + ' ', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + '' + ), + p( + 'Testing' + ) + ].join('') + const expected = [ + p( + '', + '', + '', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + '', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '', + '', + '', + '', + 'https://', + '', + 'lol.tld/', + '', + '', + '', + '', // v-if placeholder, mentionlink's "new" (i.e. rich) display + '', + '', // v-if placeholder, mentionsline's extra mentions and stuff + '', + '' + ), + ' ', + 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 a link are handled properly', () => { const html = [ '

',