aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs/components/rich_content.spec.js
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2023-01-22 09:34:01 -0500
committertusooa <tusooa@kazv.moe>2023-01-22 09:34:01 -0500
commitb1e75c25bd50180e715afde70c6e659e7509a3f3 (patch)
treef5d529d81b4bfa98009e39e7c37d64132d316592 /test/unit/specs/components/rich_content.spec.js
parent6649baaac94348bbf09015eeb2c8eeea714096db (diff)
parent0d6435261ef3e91c06fe34cc8bf72ff1b30078c2 (diff)
Merge remote-tracking branch 'upstream/develop' into birthdays
Diffstat (limited to 'test/unit/specs/components/rich_content.spec.js')
-rw-r--r--test/unit/specs/components/rich_content.spec.js21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js
index 616df6a0..427eb5ed 100644
--- a/test/unit/specs/components/rich_content.spec.js
+++ b/test/unit/specs/components/rich_content.spec.js
@@ -19,9 +19,11 @@ const global = {
}
}
-const makeMention = (who) => {
+const makeMention = (who, noClass) => {
attentions.push({ statusnet_profile_url: `https://fake.tld/@${who}` })
- return `<span class="h-card"><a class="u-url mention" href="https://fake.tld/@${who}">@<span>${who}</span></a></span>`
+ return noClass
+ ? `<span><a href="https://fake.tld/@${who}">@<span>${who}</span></a></span>`
+ : `<span class="h-card"><a class="u-url mention" href="https://fake.tld/@${who}">@<span>${who}</span></a></span>`
}
const p = (...data) => `<p>${data.join('')}</p>`
const compwrap = (...data) => `<span class="RichContent">${data.join('')}</span>`
@@ -142,6 +144,17 @@ describe('RichContent', () => {
makeMention('Josh'), makeMention('Jeremy')
].join('')
].join('\n')
+ const strippedHtml = [
+ [
+ makeMention('Jack', true),
+ 'let\'s meet up with ',
+ makeMention('Janet', true)
+ ].join(''),
+ [
+ makeMention('John', true),
+ makeMention('Josh', true), makeMention('Jeremy', true)
+ ].join('')
+ ].join('\n')
const wrapper = shallowMount(RichContent, {
global,
@@ -154,7 +167,7 @@ describe('RichContent', () => {
}
})
- expect(wrapper.html()).to.eql(compwrap(html))
+ expect(wrapper.html()).to.eql(compwrap(strippedHtml))
})
it('Adds greentext and cyantext to the post', () => {
@@ -412,7 +425,7 @@ describe('RichContent', () => {
'Testing'
].join('')
const expected = [
- '<span class="poast-style">',
+ '<span>',
'<span class="MentionsLine">',
'<span class="MentionLink mention-link">',
'<a href="lol" class="original" target="_blank">',