This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
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 #370 from asutherland/activesync-infer-junk-folder
Bug 1128883 - [email/activesync] Infer junk folder type from folder name r=jrburke,asuth
- Loading branch information
Showing
5 changed files
with
130 additions
and
8 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
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* ActiveSync-specific foldersync logic checks: | ||
* - Make sure the "Junk" folder is identified as having type 'junk'. | ||
*/ | ||
|
||
define(['rdcommon/testcontext', './resources/th_main', | ||
'activesync/codepages', 'mailapi', 'exports'], | ||
function($tc, $th_main, $ascp, $mailapi, exports) { | ||
|
||
var TD = exports.TD = $tc.defineTestsFor( | ||
{ id: 'test_activesync_foldersync' }, null, | ||
[$th_main.TESTHELPER], ['app']); | ||
|
||
TD.commonCase('junk folder type gets correctly inferred', function(T, RT) { | ||
T.group('setup'); | ||
var TEST_PARAMS = RT.envOptions; | ||
var testUniverse = T.actor('testUniverse', 'U'), | ||
// The fake IMAP server allows folderConfig to be passed as an option. | ||
// It's primarily needed to have an account that lacks specific folders | ||
// from the get-go. Let's do that some day, but for now we'll just | ||
// dynamically create the folder. | ||
testAccount = T.actor('testAccount', 'A', | ||
{ universe: testUniverse }), | ||
eCheck = T.lazyLogger('check'); | ||
|
||
var junkFolder = testAccount.do_createTestFolder('Junk', { count: 0 }); | ||
|
||
T.group('check'); | ||
T.check(eCheck, 'there better not be a muppet in here', function() { | ||
// do_createTestFolder already uses a ping to ensure the front-end state | ||
// reflects the folder. | ||
eCheck.expect_namedValueD('junk folder type', 'junk'); | ||
eCheck.namedValueD('junk folder type', | ||
junkFolder.mailFolder.type, junkFolder.mailFolder); | ||
}); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* ActiveSync-specific foldersync logic checks: | ||
* - Make sure the "Junk" folder is identified as having type 'junk'. | ||
*/ | ||
|
||
define(['rdcommon/testcontext', './resources/th_main', | ||
'activesync/codepages', 'mailapi', 'exports'], | ||
function($tc, $th_main, $ascp, $mailapi, exports) { | ||
|
||
var TD = exports.TD = $tc.defineTestsFor( | ||
{ id: 'test_activesync_foldersync' }, null, | ||
[$th_main.TESTHELPER], ['app']); | ||
|
||
TD.commonCase('junk folder type gets correctly localized', function(T, RT) { | ||
T.group('setup'); | ||
var TEST_PARAMS = RT.envOptions; | ||
var testUniverse = T.actor('testUniverse', 'U'), | ||
testAccount = T.actor('testAccount', 'A', | ||
{ universe: testUniverse }), | ||
eCheck = T.lazyLogger('check'); | ||
|
||
var localizedName = 'Sir Junksters III'; | ||
|
||
T.action('Set up MailAPI.useLocalizedStrings', function() { | ||
testUniverse.MailAPI.useLocalizedStrings({ | ||
folderNames: { | ||
junk: localizedName | ||
} | ||
}); | ||
}); | ||
|
||
junkFolder = testAccount.do_createTestFolder('istenmeyen e-posta', | ||
{ count: 0 }); | ||
|
||
T.group('check'); | ||
T.check(eCheck, 'Sir Junksters makes an appearance', function() { | ||
// do_createTestFolder already uses a ping to ensure the front-end state | ||
// reflects the folder. | ||
eCheck.expect_namedValue('localized junk name', localizedName); | ||
eCheck.namedValue('localized junk name', junkFolder.mailFolder.name); | ||
}); | ||
|
||
T.group('cleanup'); | ||
}); | ||
|
||
}); |