diff options
| author | Henry Jameson <me@hjkos.com> | 2021-06-15 14:43:44 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2021-06-15 14:43:44 +0300 |
| commit | 4aac0125e591c6f2ef51bad475e79802be51f068 (patch) | |
| tree | a00b8b3a46b67ae6b6d7f49ec6fd681dd0ddeffd /test/unit/specs/components | |
| parent | 7309f8ce1a5df1d34e33a242201b6a7b9eced2b7 (diff) | |
fixed bug with hashtags
Diffstat (limited to 'test/unit/specs/components')
| -rw-r--r-- | test/unit/specs/components/rich_content.spec.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index e364a5b3..82f1ae89 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -603,4 +603,40 @@ describe('RichContent', () => { expect(wrapper.html()).to.eql(compwrap(expected)) }) + + it('buggy example/hashtags', () => { + const html = [ + '<p>', + '<a href="http://macrochan.org/images/N/H/NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg">', + 'NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg</a>', + ' <a class="hashtag" data-tag="nou" href="https://shitposter.club/tag/nou">', + '#nou</a>', + ' <a class="hashtag" data-tag="screencap" href="https://shitposter.club/tag/screencap">', + '#screencap</a>', + ' </p>' + ].join('') + const expected = [ + '<p>', + '<a href="http://macrochan.org/images/N/H/NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg" target="_blank">', + 'NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg</a>', + ' <a class="hashtag" data-tag="nou" href="https://shitposter.club/tag/nou" target="_blank">', + '#nou</a>', + ' <a class="hashtag" data-tag="screencap" href="https://shitposter.club/tag/screencap" target="_blank">', + '#screencap</a>', + ' </p>' + ].join('') + + const wrapper = shallowMount(RichContent, { + localVue, + propsData: { + hideMentions: true, + handleLinks: true, + greentext: true, + emoji: [], + html + } + }) + + expect(wrapper.html()).to.eql(compwrap(expected)) + }) }) |
