diff options
| author | Henry Jameson <me@hjkos.com> | 2021-06-16 01:20:20 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-06-16 01:20:20 +0300 |
| commit | ad3a2fd4e5a7811107790cfba0cd83e33d2f4115 (patch) | |
| tree | e478c7a7c04cf0c94fca99ba9f020d49b3e203e8 /test | |
| parent | 4aac0125e591c6f2ef51bad475e79802be51f068 (diff) | |
fixed "invisible" spans inside links
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/specs/components/rich_content.spec.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index 82f1ae89..be51bbd1 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -639,4 +639,48 @@ describe('RichContent', () => { expect(wrapper.html()).to.eql(compwrap(expected)) }) + + it('contents of a link', () => { + const html = [ + '<p>', + 'Freenode is dead.</p>', + '<p>', + '<a href="https://isfreenodedeadyet.com/">', + '<span>', + 'https://</span>', + '<span>', + 'isfreenodedeadyet.com/</span>', + '<span>', + '</span>', + '</a>', + '</p>' + ].join('') + const expected = [ + '<p>', + 'Freenode is dead.</p>', + '<p>', + '<a href="https://isfreenodedeadyet.com/" target="_blank">', + '<span>', + 'https://</span>', + '<span>', + 'isfreenodedeadyet.com/</span>', + '<span>', + '</span>', + '</a>', + '</p>' + ].join('') + + const wrapper = shallowMount(RichContent, { + localVue, + propsData: { + hideMentions: false, + handleLinks: true, + greentext: true, + emoji: [], + html + } + }) + + expect(wrapper.html()).to.eql(compwrap(expected)) + }) }) |
