aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2016-11-27 18:54:51 +0100
committerRoger Braun <roger@rogerbraun.net>2016-11-27 18:57:33 +0100
commit51988e75b6462bffc655fd5638325e0465201cbc (patch)
tree954c0d26b89c6ee4acc3ea53b1a54ef9189f1e09 /test
parentff93d1edeefae88cc1b9e9efe4f22c8787e5f792 (diff)
Add repeat notifications.
Diffstat (limited to 'test')
-rw-r--r--test/unit/specs/modules/statuses.spec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js
index e6abbd91..bdb6293e 100644
--- a/test/unit/specs/modules/statuses.spec.js
+++ b/test/unit/specs/modules/statuses.spec.js
@@ -165,6 +165,22 @@ describe('The Statuses module', () => {
expect(retweet.retweeted_status.text).to.eql(modStatus.text)
})
+ it('adds a notfications for retweets if you are the retweetet', () => {
+ const user = { id: 1 }
+ const state = cloneDeep(defaultState)
+ const status = makeMockStatus({id: 1})
+ status.user = user
+ const retweet = makeMockStatus({id: 2, is_post_verb: false})
+ retweet.retweeted_status = status
+
+ mutations.addNewStatuses(state, { statuses: [retweet], user })
+
+ expect(state.notifications.length).to.eql(1)
+ expect(state.notifications[0].status).to.eql(status)
+ expect(state.notifications[0].action).to.eql(retweet)
+ expect(state.notifications[0].type).to.eql('repeat')
+ })
+
it('replaces existing statuses with the same id', () => {
const state = cloneDeep(defaultState)
const status = makeMockStatus({id: 1})