aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs/components
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/specs/components')
-rw-r--r--test/unit/specs/components/rich_content.spec.js21
-rw-r--r--test/unit/specs/components/user_profile.spec.js5
2 files changed, 21 insertions, 5 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">',
diff --git a/test/unit/specs/components/user_profile.spec.js b/test/unit/specs/components/user_profile.spec.js
index 0fbab722..dc0b938a 100644
--- a/test/unit/specs/components/user_profile.spec.js
+++ b/test/unit/specs/components/user_profile.spec.js
@@ -15,6 +15,7 @@ const actions = {
const testGetters = {
findUser: state => getters.findUser(state.users),
+ findUserByName: state => getters.findUserByName(state.users),
relationship: state => getters.relationship(state.users),
mergedConfig: state => ({
colors: '',
@@ -95,6 +96,7 @@ const externalProfileStore = createStore({
credentials: ''
},
usersObject: { 100: extUser },
+ usersByNameObject: {},
users: [extUser],
relationships: {}
}
@@ -163,7 +165,8 @@ const localProfileStore = createStore({
currentUser: {
credentials: ''
},
- usersObject: { 100: localUser, testuser: localUser },
+ usersObject: { 100: localUser },
+ usersByNameObject: { testuser: localUser },
users: [localUser],
relationships: {}
}