aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/unit/specs/modules/statuses.spec.js4
-rw-r--r--test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js7
-rw-r--r--test/unit/specs/services/version/version.service.spec.js11
3 files changed, 20 insertions, 2 deletions
diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js
index 0bbcb25a..e4661e2a 100644
--- a/test/unit/specs/modules/statuses.spec.js
+++ b/test/unit/specs/modules/statuses.spec.js
@@ -258,11 +258,11 @@ describe('Statuses module', () => {
})
describe('clearTimeline', () => {
- it('keeps userId when clearing user timeline', () => {
+ it('keeps userId when clearing user timeline when excludeUserId param is true', () => {
const state = defaultState()
state.timelines.user.userId = 123
- mutations.clearTimeline(state, { timeline: 'user' })
+ mutations.clearTimeline(state, { timeline: 'user', excludeUserId: true })
expect(state.timelines.user.userId).to.eql(123)
})
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 3d34c5cc..b3491c61 100644
--- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
+++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js
@@ -282,6 +282,13 @@ describe('API Entities normalizer', () => {
expect(parsedUser).to.have.property('description_html').that.contains('<img')
})
+
+ it('adds hide_follows and hide_followers user settings', () => {
+ const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false } })
+
+ expect(parseUser(user)).to.have.property('hide_followers', true)
+ expect(parseUser(user)).to.have.property('hide_follows', false)
+ })
})
// We currently use QvitterAPI notifications only, and especially due to MastoAPI lacking is_seen, support for MastoAPI
diff --git a/test/unit/specs/services/version/version.service.spec.js b/test/unit/specs/services/version/version.service.spec.js
new file mode 100644
index 00000000..519145ee
--- /dev/null
+++ b/test/unit/specs/services/version/version.service.spec.js
@@ -0,0 +1,11 @@
+import { extractCommit } from 'src/services/version/version.service.js'
+
+describe('extractCommit', () => {
+ it('return short commit hash following "-g" characters', () => {
+ expect(extractCommit('1.0.0-45-g5e7aeebc')).to.eql('5e7aeebc')
+ })
+
+ it('return short commit hash without branch name', () => {
+ expect(extractCommit('1.0.0-45-g5e7aeebc-branch')).to.eql('5e7aeebc')
+ })
+})