1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-25 18:32:20 -05:00

[WO-696] List trash before flagged in wellknown folders

This commit is contained in:
Felix Hammerl 2014-11-05 11:36:42 +01:00
parent 8f1fd2de5f
commit 14dc80ec3c
2 changed files with 23 additions and 6 deletions

View File

@ -1442,8 +1442,8 @@ EmailDAO.prototype._initFoldersFromImap = function(callback) {
FOLDER_TYPE_SENT,
config.outboxMailboxType,
FOLDER_TYPE_DRAFTS,
FOLDER_TYPE_FLAGGED,
FOLDER_TYPE_TRASH
FOLDER_TYPE_TRASH,
FOLDER_TYPE_FLAGGED
];
// make sure the well known folders are detected

View File

@ -25,7 +25,7 @@ describe('Email DAO unit tests', function() {
var emailAddress, passphrase, asymKeySize, account;
// test data
var folders, inboxFolder, sentFolder, draftsFolder, outboxFolder, trashFolder, otherFolder, mockKeyPair;
var folders, inboxFolder, sentFolder, draftsFolder, outboxFolder, trashFolder, flaggedFolder, otherFolder, mockKeyPair;
beforeEach(function() {
//
@ -70,6 +70,13 @@ describe('Email DAO unit tests', function() {
messages: []
};
flaggedFolder = {
name: 'Flagged',
type: 'Flagged',
path: 'FLAGGED',
messages: []
};
otherFolder = {
name: 'Other',
type: 'Other',
@ -2105,6 +2112,7 @@ describe('Email DAO unit tests', function() {
Sent: [sentFolder],
Drafts: [draftsFolder],
Trash: [trashFolder],
Flagged: [flaggedFolder],
Other: [otherFolder]
});
devicestorageStub.storeList.withArgs(sinon.match(function(arg) {
@ -2123,9 +2131,12 @@ describe('Email DAO unit tests', function() {
expect(arg[0][4].name).to.deep.equal(trashFolder.name);
expect(arg[0][4].path).to.deep.equal(trashFolder.path);
expect(arg[0][4].type).to.deep.equal(trashFolder.type);
expect(arg[0][5].name).to.deep.equal(otherFolder.name);
expect(arg[0][5].path).to.deep.equal(otherFolder.path);
expect(arg[0][5].type).to.deep.equal(otherFolder.type);
expect(arg[0][5].name).to.deep.equal(flaggedFolder.name);
expect(arg[0][5].path).to.deep.equal(flaggedFolder.path);
expect(arg[0][5].type).to.deep.equal(flaggedFolder.type);
expect(arg[0][6].name).to.deep.equal(otherFolder.name);
expect(arg[0][6].path).to.deep.equal(otherFolder.path);
expect(arg[0][6].type).to.deep.equal(otherFolder.type);
return true;
}), 'folders').yieldsAsync();
@ -2151,6 +2162,7 @@ describe('Email DAO unit tests', function() {
Sent: [sentFolder],
Drafts: [draftsFolder],
Trash: [trashFolder],
Flagged: [flaggedFolder],
Other: [otherFolder]
});
devicestorageStub.storeList.withArgs(sinon.match(function(arg) {
@ -2179,6 +2191,11 @@ describe('Email DAO unit tests', function() {
path: trashFolder.path,
type: trashFolder.type,
wellknown: true
}, {
name: flaggedFolder.name,
path: flaggedFolder.path,
type: flaggedFolder.type,
wellknown: true
}, {
name: otherFolder.name,
path: otherFolder.path,