1
0
mirror of https://github.com/moparisthebest/mail synced 2025-02-07 10:30:18 -05:00

add unit test for syncOutbox

This commit is contained in:
Felix Hammerl 2014-02-25 15:10:29 +01:00
parent 336b4a4a7f
commit debb06c943

View File

@ -2609,6 +2609,29 @@ define(function(require) {
expect(pgpMailerStub.send.calledOnce).to.be.true; expect(pgpMailerStub.send.calledOnce).to.be.true;
done();
});
});
});
describe('syncOutbox', function() {
it('should sync the outbox', function(done) {
var folder = 'FOLDAAAA';
dao._account.folders = [{
type: 'Folder',
path: folder
}];
var localListStub = sinon.stub(dao, '_localListMessages').withArgs({
folder: folder
}).yields(null, [dummyEncryptedMail]);
dao.syncOutbox({
folder: folder
}, function(err) {
expect(err).to.not.exist;
expect(localListStub.calledOnce).to.be.true;
expect(dao._account.folders[0].messages.length).to.equal(1);
done(); done();
}); });
}); });