aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/specs')
-rw-r--r--test/unit/specs/components/user_profile.spec.js7
-rw-r--r--test/unit/specs/modules/users.spec.js14
-rw-r--r--test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js8
-rw-r--r--test/unit/specs/services/status_parser/status_parses.spec.js17
4 files changed, 9 insertions, 37 deletions
diff --git a/test/unit/specs/components/user_profile.spec.js b/test/unit/specs/components/user_profile.spec.js
index 1b6a47d7..dcf066f9 100644
--- a/test/unit/specs/components/user_profile.spec.js
+++ b/test/unit/specs/components/user_profile.spec.js
@@ -19,6 +19,7 @@ const actions = {
const testGetters = {
findUser: state => getters.findUser(state.users),
+ relationship: state => getters.relationship(state.users),
mergedConfig: state => ({
colors: '',
highlight: {},
@@ -96,7 +97,8 @@ const externalProfileStore = new Vuex.Store({
credentials: ''
},
usersObject: { 100: extUser },
- users: [extUser]
+ users: [extUser],
+ relationships: {}
}
}
})
@@ -164,7 +166,8 @@ const localProfileStore = new Vuex.Store({
credentials: ''
},
usersObject: { 100: localUser, 'testuser': localUser },
- users: [localUser]
+ users: [localUser],
+ relationships: {}
}
}
})
diff --git a/test/unit/specs/modules/users.spec.js b/test/unit/specs/modules/users.spec.js
index eeb7afef..670acfc8 100644
--- a/test/unit/specs/modules/users.spec.js
+++ b/test/unit/specs/modules/users.spec.js
@@ -18,20 +18,6 @@ describe('The users module', () => {
expect(state.users).to.eql([user])
expect(state.users[0].name).to.eql('Dude')
})
-
- it('sets a mute bit on users', () => {
- const state = cloneDeep(defaultState)
- const user = { id: '1', name: 'Guy' }
-
- mutations.addNewUsers(state, [user])
- mutations.setMuted(state, { user, muted: true })
-
- expect(user.muted).to.eql(true)
-
- mutations.setMuted(state, { user, muted: false })
-
- expect(user.muted).to.eql(false)
- })
})
describe('findUser', () => {
diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
index cfb380ba..166fce2b 100644
--- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
+++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
@@ -338,9 +338,9 @@ describe('API Entities normalizer', () => {
describe('MastoAPI emoji adder', () => {
const emojis = makeMockEmojiMasto()
- const imageHtml = '<img src="https://example.com/image.png" alt="image" title="image" class="emoji" />'
+ const imageHtml = '<img src="https://example.com/image.png" alt=":image:" title=":image:" class="emoji" />'
.replace(/"/g, '\'')
- const thinkHtml = '<img src="https://example.com/think.png" alt="thinking" title="thinking" class="emoji" />'
+ const thinkHtml = '<img src="https://example.com/think.png" alt=":thinking:" title=":thinking:" class="emoji" />'
.replace(/"/g, '\'')
it('correctly replaces shortcodes in supplied string', () => {
@@ -366,8 +366,8 @@ describe('API Entities normalizer', () => {
shortcode: '[a-z] {|}*'
}])
const result = addEmojis('This post has :c++: emoji and :[a-z] {|}*: emoji', emojis)
- expect(result).to.include('title=\'c++\'')
- expect(result).to.include('title=\'[a-z] {|}*\'')
+ expect(result).to.include('title=\':c++:\'')
+ expect(result).to.include('title=\':[a-z] {|}*:\'')
})
})
})
diff --git a/test/unit/specs/services/status_parser/status_parses.spec.js b/test/unit/specs/services/status_parser/status_parses.spec.js
deleted file mode 100644
index 7afd5042..00000000
--- a/test/unit/specs/services/status_parser/status_parses.spec.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { removeAttachmentLinks } from '../../../../../src/services/status_parser/status_parser.js'
-
-const example = '<div class="status-content">@<a href="https://sealion.club/user/4" class="h-card mention" title="dewoo">dwmatiz</a> <a href="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" title="https://social.heldscal.la/file/3deb764ada10ce64a61b7a070b75dac45f86d2d5bf213bf18873da71d8714d86.png" class="attachment" id="attachment-159853" rel="nofollow external">https://social.heldscal.la/attachment/159853</a></div>'
-
-describe('statusParser.removeAttachmentLinks', () => {
- const exampleWithoutAttachmentLinks = '<div class="status-content">@<a href="https://sealion.club/user/4" class="h-card mention" title="dewoo">dwmatiz</a> </div>'
-
- it('removes attachment links', () => {
- const parsed = removeAttachmentLinks(example)
- expect(parsed).to.eql(exampleWithoutAttachmentLinks)
- })
-
- it('works when the class is empty', () => {
- const parsed = removeAttachmentLinks('<a></a>')
- expect(parsed).to.eql('<a></a>')
- })
-})