forked from linagora/openpaas-esn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2245 in OR/rse from ~DDOLCIMASCOLO/rse:INBOX-286 …
…to master * commit '78aaaf4c0534e79b18d915bef7b8b02aa5e659ed': INBOX-287 Fixed Inbox to accomodate Message.replyTo being an array in JMAP.
- Loading branch information
Showing
3 changed files
with
27 additions
and
19 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 |
---|---|---|
|
@@ -740,13 +740,13 @@ describe('The Unified Inbox Angular module services', function() { | |
expect(emailSendingService.getReplyAllRecipients(email, sender)).to.shallowDeepEqual(expectedEmail); | ||
}); | ||
|
||
it('should leverage the replyTo filed instead of FROM (when provided)', function() { | ||
it('should leverage the replyTo field instead of FROM (when provided)', function() { | ||
email = { | ||
to: [{displayName: '1', email: '[email protected]'}, {displayName: '2', email: '[email protected]'}], | ||
cc: [{displayName: '3', email: '[email protected]'}, {displayName: '4', email: '[email protected]'}], | ||
bcc: [{displayName: '5', email: '[email protected]'}, {displayName: '6', email: '[email protected]'}], | ||
from: {displayName: '0', email: '[email protected]'}, | ||
replyTo: {displayName: 'replyToEmail', email: '[email protected]'} | ||
replyTo: [{displayName: 'replyToEmail', email: '[email protected]'}] | ||
}; | ||
|
||
sender = {displayName: 'sender', email: '[email protected]'}; | ||
|
@@ -807,37 +807,47 @@ describe('The Unified Inbox Angular module services', function() { | |
|
||
describe('The getReplyRecipients function', function() { | ||
var email, sender, expectedEmail; | ||
|
||
it('should do nothing when email is not provided', function() { | ||
expect(emailSendingService.getReplyRecipients(null)).to.be.undefined; | ||
}); | ||
|
||
it('should reply to FROM if FROM is not the sender', function() { | ||
it('should reply to FROM if ReplyTo is not present', function() { | ||
email = { | ||
from: {displayName: '0', email: '[email protected]'} | ||
}; | ||
|
||
sender = {displayName: 'sender', email: '[email protected]'}; | ||
|
||
expectedEmail = { | ||
to: [{displayName: '0', email: '[email protected]'}] | ||
}; | ||
|
||
expect(emailSendingService.getReplyRecipients(email, sender)).to.shallowDeepEqual(expectedEmail); | ||
expect(emailSendingService.getReplyRecipients(email)).to.shallowDeepEqual(expectedEmail); | ||
}); | ||
|
||
it('should reply to ReplyTo if ReplyTo is not the sender', function() { | ||
it('should reply to ReplyTo if ReplyTo is present', function() { | ||
email = { | ||
from: {displayName: '0', email: '[email protected]'}, | ||
replyTo: {displayName: 'replyto', email: '[email protected]'} | ||
replyTo: [{displayName: 'replyto', email: '[email protected]'}] | ||
}; | ||
|
||
sender = {displayName: 'sender', email: '[email protected]'}; | ||
|
||
expectedEmail = { | ||
to: [{displayName: 'replyto', email: '[email protected]'}] | ||
}; | ||
|
||
expect(emailSendingService.getReplyRecipients(email, sender)).to.shallowDeepEqual(expectedEmail); | ||
expect(emailSendingService.getReplyRecipients(email)).to.shallowDeepEqual(expectedEmail); | ||
}); | ||
|
||
it('should reply to ReplyTo if ReplyTo is present, filtering out unknown EMailers', function() { | ||
email = { | ||
from: {displayName: '0', email: '[email protected]'}, | ||
replyTo: [{displayName: 'replyto', email: '[email protected]'}, { email: '@' }, { name: 'second', email: '[email protected]' }] | ||
}; | ||
|
||
expectedEmail = { | ||
to: [{displayName: 'replyto', email: '[email protected]'}, { name: 'second', email: '[email protected]' }] | ||
}; | ||
|
||
expect(emailSendingService.getReplyRecipients(email)).to.shallowDeepEqual(expectedEmail); | ||
}); | ||
|
||
}); | ||
|