diff --git a/spec/renderer/integration/store/TimelineSpace/Contents/Mentions.spec.ts b/spec/renderer/integration/store/TimelineSpace/Contents/Mentions.spec.ts index a2f63ac6..6c969be5 100644 --- a/spec/renderer/integration/store/TimelineSpace/Contents/Mentions.spec.ts +++ b/spec/renderer/integration/store/TimelineSpace/Contents/Mentions.spec.ts @@ -115,8 +115,7 @@ let state: Function = () => { return { lazyLoading: false, heading: true, - mentions: [], - unreadMentions: [] + mentions: [] } } @@ -176,8 +175,7 @@ describe('Mentions', () => { return { lazyLoading: true, heading: true, - mentions: [], - unreadMentions: [] + mentions: [] } } }) @@ -193,8 +191,7 @@ describe('Mentions', () => { return { lazyLoading: false, heading: true, - mentions: [mention, reblog], - unreadMentions: [] + mentions: [mention, reblog] } } }) @@ -224,8 +221,7 @@ describe('Mentions', () => { return { lazyLoading: false, heading: true, - mentions: [mention, favourite, reblog, follow], - unreadMentions: [] + mentions: [mention, favourite, reblog, follow] } } }) diff --git a/spec/renderer/unit/store/TimelineSpace/Contents/Mentions.spec.ts b/spec/renderer/unit/store/TimelineSpace/Contents/Mentions.spec.ts index d8cd0504..de045539 100644 --- a/spec/renderer/unit/store/TimelineSpace/Contents/Mentions.spec.ts +++ b/spec/renderer/unit/store/TimelineSpace/Contents/Mentions.spec.ts @@ -173,8 +173,7 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: true, - mentions: [], - unreadMentions: [] + mentions: [] } }) @@ -185,14 +184,12 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: true, - mentions: [notification1], - unreadMentions: [] + mentions: [notification1] } }) it('should update mentions', () => { Mentions.mutations![MUTATION_TYPES.APPEND_MENTIONS](state, notification2) expect(state.mentions).toEqual([notification2, notification1]) - expect(state.unreadMentions).toEqual([]) }) }) @@ -201,14 +198,12 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: true, - mentions: [notification2, notification1], - unreadMentions: [] + mentions: [notification2, notification1] } }) it('should not be updated mentions', () => { Mentions.mutations![MUTATION_TYPES.APPEND_MENTIONS](state, notification2) expect(state.mentions).toEqual([notification2, notification1]) - expect(state.unreadMentions).toEqual([]) }) }) }) @@ -219,14 +214,12 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: false, - mentions: [notification1], - unreadMentions: [] + mentions: [notification1] } }) it('should update mentions', () => { Mentions.mutations![MUTATION_TYPES.APPEND_MENTIONS](state, notification2) - expect(state.mentions).toEqual([notification1]) - expect(state.unreadMentions).toEqual([notification2]) + expect(state.mentions).toEqual([notification2, notification1]) }) }) @@ -235,42 +228,23 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: false, - mentions: [notification1], - unreadMentions: [notification2] + mentions: [notification2, notification1] } }) it('should not be updated mentions', () => { Mentions.mutations![MUTATION_TYPES.APPEND_MENTIONS](state, notification2) - expect(state.mentions).toEqual([notification1]) - expect(state.unreadMentions).toEqual([notification2]) + expect(state.mentions).toEqual([notification2, notification1]) }) }) }) }) - describe('mergeMentions', () => { - beforeEach(() => { - state = { - lazyLoading: false, - heading: false, - mentions: [notification1], - unreadMentions: [notification2] - } - }) - it('should be merged', () => { - Mentions.mutations![MUTATION_TYPES.MERGE_MENTIONS](state, null) - expect(state.mentions).toEqual([notification2, notification1]) - expect(state.unreadMentions).toEqual([]) - }) - }) - describe('insertMentions', () => { beforeEach(() => { state = { lazyLoading: false, heading: false, - mentions: [notification2], - unreadMentions: [] + mentions: [notification2] } }) it('should be inserted', () => { @@ -284,8 +258,7 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: false, - mentions: [notification2, notification1], - unreadMentions: [] + mentions: [notification2, notification1] } }) it('should be updated', () => { @@ -304,8 +277,7 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: true, - mentions: [notification2, notification1], - unreadMentions: [] + mentions: [notification2, notification1] } }) it('should be deleted', () => { @@ -318,8 +290,7 @@ describe('TimelineSpace/Contents/Mentions', () => { state = { lazyLoading: false, heading: true, - mentions: [notification2, notification1], - unreadMentions: [] + mentions: [notification2, notification1] } }) it('should be deleted', () => { diff --git a/src/renderer/components/TimelineSpace/Contents/Mentions.vue b/src/renderer/components/TimelineSpace/Contents/Mentions.vue index e96c00c1..c6a77506 100644 --- a/src/renderer/components/TimelineSpace/Contents/Mentions.vue +++ b/src/renderer/components/TimelineSpace/Contents/Mentions.vue @@ -1,8 +1,7 @@