forked from runbox/runbox7
-
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.
feat(mailviewer): Add sender/domain blocking functionality
- Loading branch information
Showing
10 changed files
with
64 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,14 @@ describe('MailAddressInfo', () => { | |
expect(ma.name).toBe('Test'); | ||
expect(ma.address).toBe('[email protected]'); | ||
expect(ma.nameAndAddress).toBe('"Test" <[email protected]>'); | ||
expect(ma.domain).toBe('runbox.com'); | ||
}); | ||
it('Parse single email address', () => { | ||
const ma = MailAddressInfo.parse('[email protected]'); | ||
expect(ma[0].name).toBe(null); | ||
expect(ma[0].address).toBe('[email protected]'); | ||
expect(ma[0].nameAndAddress).toBe('[email protected]'); | ||
expect(ma[0].domain).toBe('runbox.com'); | ||
}); | ||
it('Parse full single address', () => { | ||
const ma = MailAddressInfo.parse('"Test" <[email protected]>'); | ||
|
@@ -68,4 +70,11 @@ describe('MailAddressInfo', () => { | |
expect(ma_list[1].address).toBe('[email protected]'); | ||
expect(ma_list[1].nameAndAddress).toBe('"Test2" <[email protected]>'); | ||
}); | ||
it('Parse multi-level domain', () => { | ||
const ma_list = MailAddressInfo.parse('"Fred B" <[email protected]>'); | ||
expect(ma_list[0].name).toBe('Fred B'); | ||
expect(ma_list[0].address).toBe('[email protected]'); | ||
expect(ma_list[0].nameAndAddress).toBe('"Fred B" <[email protected]>'); | ||
expect(ma_list[0].domain).toBe('foo.bar.baz.tld'); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,7 +137,8 @@ describe('SingleMailViewerComponent', () => { | |
mid: messageId, | ||
headers: { | ||
from: { | ||
value: '[email protected]' | ||
value: [{ 'address': '[email protected]', | ||
'name': 'Testy' }] | ||
}, | ||
date: new Date(2016, 0, 1).toJSON(), | ||
subject: 'Test subject' | ||
|
@@ -200,6 +201,9 @@ describe('SingleMailViewerComponent', () => { | |
trainSpam(params: any) { | ||
throw new Error('Method not implemented.'); | ||
} | ||
blockSender(param: any) { | ||
throw new Error('Method not implemented.'); | ||
} | ||
}; | ||
fixture.autoDetectChanges(); | ||
}); | ||
|
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