mirror of
https://github.com/moparisthebest/mail
synced 2025-02-07 02:20:14 -05:00
add unit test for syncOutbox
This commit is contained in:
parent
336b4a4a7f
commit
debb06c943
@ -2579,7 +2579,7 @@ define(function(require) {
|
|||||||
it('should work', function(done) {
|
it('should work', function(done) {
|
||||||
var publicKeys = ["PUBLIC KEY"];
|
var publicKeys = ["PUBLIC KEY"];
|
||||||
dummyDecryptedMail.publicKeysArmored = publicKeys;
|
dummyDecryptedMail.publicKeysArmored = publicKeys;
|
||||||
|
|
||||||
pgpMailerStub.send.withArgs({
|
pgpMailerStub.send.withArgs({
|
||||||
encrypt: true,
|
encrypt: true,
|
||||||
cleartextMessage: str.message,
|
cleartextMessage: str.message,
|
||||||
@ -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();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user