From 93bca5f8510ee037520fcb0b614521bf181c83c7 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Wed, 15 Jun 2022 17:53:52 +0100 Subject: [PATCH] fix tests --- src/components/rich_content/rich_content.jsx | 20 ------------------- .../specs/components/rich_content.spec.js | 4 ++-- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 4a31dbc5..ca075270 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -112,23 +112,6 @@ export default { } } - const renderLink = (attrs, children) => { - const updatedLink = attrs['href'].replace(/&/g, '&') - const updatedChildren = children.map(child => { - if (typeof child === 'string') { - return child.replace(attrs['href'], updatedLink) - } - if (child[0] === '') { - return - { child[1] } - - } - return child[1] - }) - return - { ...updatedChildren } - - } // Processor to use with html_tree_converter const processItem = (item, index, array, what) => { // Handle text nodes - just add emoji @@ -193,9 +176,6 @@ export default { return renderMention(attrs, children) } else { currentMentions = null - if (attrs['href']) { - return renderLink(attrs, children) - } break } case 'span': diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index a1299e6f..ea26ee43 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -44,12 +44,12 @@ describe('RichContent', () => { const html = [ p('Testing 'em all'), 'Testing 'em all', - 'http://example.com?a=1&b=2' + 'http://example.com?a=1' ].join('') const expected = [ p('Testing \'em all'), 'Testing \'em all', - 'http://example.com?a=1&b=2' + 'http://example.com?a=1' ].join('') const wrapper = shallowMount(RichContent, { global,