aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2016-11-28 14:49:42 +0100
committerRoger Braun <roger@rogerbraun.net>2016-11-28 14:49:42 +0100
commite0a108fcaba7d59e74795445299169b1ff9ee6cc (patch)
tree75520e3588b843e7b989aa76f711289f728f985c
parent6fad01339cb3f8514429d03869a9c8ff2a343b02 (diff)
Move specs around.
-rw-r--r--test/unit/specs/modules/statuses.spec.js68
1 files changed, 34 insertions, 34 deletions
diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js
index 6407fc93..6d304da6 100644
--- a/test/unit/specs/modules/statuses.spec.js
+++ b/test/unit/specs/modules/statuses.spec.js
@@ -166,40 +166,6 @@ 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('adds a notification when you are mentioned', () => {
- const user = { id: 1 }
- const state = cloneDeep(defaultState)
- const status = makeMockStatus({id: 1})
- const mentionedStatus = makeMockStatus({id: 2})
- mentionedStatus.attentions = [user]
-
- mutations.addNewStatuses(state, { statuses: [status], user })
-
- expect(state.notifications.length).to.eql(0)
-
- mutations.addNewStatuses(state, { statuses: [mentionedStatus], user })
- expect(state.notifications.length).to.eql(1)
- expect(state.notifications[0].status).to.eql(mentionedStatus)
- expect(state.notifications[0].action).to.eql(mentionedStatus)
- expect(state.notifications[0].type).to.eql('mention')
- })
-
it('replaces existing statuses with the same id', () => {
const state = cloneDeep(defaultState)
const status = makeMockStatus({id: 1})
@@ -287,6 +253,40 @@ describe('The Statuses module', () => {
})
describe('notifications', () => {
+ 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('adds a notification when you are mentioned', () => {
+ const user = { id: 1 }
+ const state = cloneDeep(defaultState)
+ const status = makeMockStatus({id: 1})
+ const mentionedStatus = makeMockStatus({id: 2})
+ mentionedStatus.attentions = [user]
+
+ mutations.addNewStatuses(state, { statuses: [status], user })
+
+ expect(state.notifications.length).to.eql(0)
+
+ mutations.addNewStatuses(state, { statuses: [mentionedStatus], user })
+ expect(state.notifications.length).to.eql(1)
+ expect(state.notifications[0].status).to.eql(mentionedStatus)
+ expect(state.notifications[0].action).to.eql(mentionedStatus)
+ expect(state.notifications[0].type).to.eql('mention')
+ })
+
it('adds a notfication when one of the user\'s status is favorited', () => {
const state = cloneDeep(defaultState)
const status = makeMockStatus({id: 1})