From 58ac8f51a219681e237494b8a730048f2eafbe58 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sat, 3 Dec 2016 12:43:21 +0100 Subject: Treat mentions more like a timeline. --- test/unit/specs/modules/statuses.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/unit/specs/modules/statuses.spec.js') diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js index c9c1ad2c..deeeb477 100644 --- a/test/unit/specs/modules/statuses.spec.js +++ b/test/unit/specs/modules/statuses.spec.js @@ -292,6 +292,22 @@ describe('The Statuses module', () => { expect(state.notifications[0].type).to.eql('mention') }) + it('adds the message to mentions 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.timelines.mentions.statuses).to.have.length(0) + + mutations.addNewStatuses(state, { statuses: [mentionedStatus], user }) + expect(state.timelines.mentions.statuses).to.have.length(1) + expect(state.timelines.mentions.statuses).to.eql([mentionedStatus]) + }) + it('adds a notfication when one of the user\'s status is favorited', () => { const state = cloneDeep(defaultState) const status = makeMockStatus({id: 1}) -- cgit v1.2.3-70-g09d2