-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not show outbox if not caught up (#1262)
- Loading branch information
1 parent
e09648c
commit b23628a
Showing
10 changed files
with
63 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ describe('getMessagesInActiveNarrow', () => { | |
expect(anchor).toBe(state.chat.messages['[]']); | ||
}); | ||
|
||
test('combine messages & outbox in same narrow', () => { | ||
test('combine messages and outbox in same narrow', () => { | ||
const state = deepFreeze({ | ||
chat: { | ||
narrow: homeNarrow, | ||
|
@@ -42,6 +42,9 @@ describe('getMessagesInActiveNarrow', () => { | |
timestamp: 12, | ||
}, | ||
], | ||
caughtUp: { | ||
[homeNarrowStr]: { older: false, newer: true }, | ||
}, | ||
}); | ||
|
||
const anchor = getMessagesInActiveNarrow(state); | ||
|
@@ -60,7 +63,31 @@ describe('getMessagesInActiveNarrow', () => { | |
expect(anchor).toEqual(expectedState); | ||
}); | ||
|
||
test('do not combine messages & outbox in different narrow', () => { | ||
test('do not combine messages and outbox if not caught up', () => { | ||
const state = deepFreeze({ | ||
chat: { | ||
narrow: homeNarrow, | ||
messages: { | ||
[homeNarrowStr]: [{ id: 123 }], | ||
}, | ||
}, | ||
outbox: [ | ||
{ | ||
email: '[email protected]', | ||
narrow: homeNarrow, | ||
parsedContent: '<p>Hello</p>', | ||
sender_full_name: 'donald', | ||
timestamp: 12, | ||
}, | ||
], | ||
}); | ||
|
||
const anchor = getMessagesInActiveNarrow(state); | ||
|
||
expect(anchor).toBe(state.chat.messages[homeNarrowStr]); | ||
}); | ||
|
||
test('do not combine messages and outbox in different narrow', () => { | ||
const state = deepFreeze({ | ||
chat: { | ||
narrow: privateNarrow('[email protected]'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters