mirror of
https://github.com/moparisthebest/mail
synced 2025-02-07 02:20:14 -05:00
remove pgpmailer.login()
This commit is contained in:
parent
71dad31d6f
commit
37d4a74aa3
@ -13,7 +13,7 @@
|
|||||||
"crypto-lib": "https://github.com/whiteout-io/crypto-lib/tarball/master",
|
"crypto-lib": "https://github.com/whiteout-io/crypto-lib/tarball/master",
|
||||||
"imap-client": "https://github.com/whiteout-io/imap-client/tarball/master",
|
"imap-client": "https://github.com/whiteout-io/imap-client/tarball/master",
|
||||||
"mailreader": "https://github.com/whiteout-io/mailreader/tarball/master",
|
"mailreader": "https://github.com/whiteout-io/mailreader/tarball/master",
|
||||||
"pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/master",
|
"pgpmailer": "https://github.com/whiteout-io/pgpmailer/tarball/dev/fix-smtp",
|
||||||
"pgpbuilder": "https://github.com/whiteout-io/pgpbuilder/tarball/master",
|
"pgpbuilder": "https://github.com/whiteout-io/pgpbuilder/tarball/master",
|
||||||
"requirejs": "2.1.10"
|
"requirejs": "2.1.10"
|
||||||
},
|
},
|
||||||
|
@ -82,9 +82,6 @@ define(function(require) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// connect the pgpmailer
|
|
||||||
self._pgpmailerLogin();
|
|
||||||
|
|
||||||
// connect to newly created imap client
|
// connect to newly created imap client
|
||||||
self._imapLogin(function(err) {
|
self._imapLogin(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -1110,16 +1107,6 @@ define(function(require) {
|
|||||||
this._devicestorage.removeList(dbType, callback);
|
this._devicestorage.removeList(dbType, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// PGP Mailer API
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Login the smtp client
|
|
||||||
*/
|
|
||||||
EmailDAO.prototype._pgpmailerLogin = function() {
|
|
||||||
this._pgpMailer.login();
|
|
||||||
};
|
|
||||||
|
|
||||||
// IMAP API
|
// IMAP API
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -278,12 +278,11 @@ define(function(require) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('onConnect', function() {
|
describe('onConnect', function() {
|
||||||
var imapLoginStub, imapListFoldersStub, pgpmailerLoginStub;
|
var imapLoginStub, imapListFoldersStub;
|
||||||
|
|
||||||
beforeEach(function(done) {
|
beforeEach(function(done) {
|
||||||
// imap login
|
// imap login
|
||||||
imapLoginStub = sinon.stub(dao, '_imapLogin');
|
imapLoginStub = sinon.stub(dao, '_imapLogin');
|
||||||
pgpmailerLoginStub = sinon.stub(dao, '_pgpmailerLogin');
|
|
||||||
imapListFoldersStub = sinon.stub(dao, '_imapListFolders');
|
imapListFoldersStub = sinon.stub(dao, '_imapListFolders');
|
||||||
|
|
||||||
dao.onDisconnect(null, function(err) {
|
dao.onDisconnect(null, function(err) {
|
||||||
@ -297,20 +296,17 @@ define(function(require) {
|
|||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
imapLoginStub.restore();
|
imapLoginStub.restore();
|
||||||
pgpmailerLoginStub.restore();
|
|
||||||
imapListFoldersStub.restore();
|
imapListFoldersStub.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fail due to error in imap login', function(done) {
|
it('should fail due to error in imap login', function(done) {
|
||||||
imapLoginStub.yields({});
|
imapLoginStub.yields({});
|
||||||
pgpmailerLoginStub.returns();
|
|
||||||
|
|
||||||
dao.onConnect({
|
dao.onConnect({
|
||||||
imapClient: imapClientStub,
|
imapClient: imapClientStub,
|
||||||
pgpMailer: pgpMailerStub
|
pgpMailer: pgpMailerStub
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
expect(err).to.exist;
|
expect(err).to.exist;
|
||||||
expect(pgpmailerLoginStub.calledOnce).to.be.true;
|
|
||||||
expect(imapLoginStub.calledOnce).to.be.true;
|
expect(imapLoginStub.calledOnce).to.be.true;
|
||||||
expect(dao._account.online).to.be.false;
|
expect(dao._account.online).to.be.false;
|
||||||
done();
|
done();
|
||||||
@ -320,7 +316,6 @@ define(function(require) {
|
|||||||
it('should work when folder already initiated', function(done) {
|
it('should work when folder already initiated', function(done) {
|
||||||
dao._account.folders = [];
|
dao._account.folders = [];
|
||||||
imapLoginStub.yields();
|
imapLoginStub.yields();
|
||||||
pgpmailerLoginStub.returns();
|
|
||||||
|
|
||||||
dao.onConnect({
|
dao.onConnect({
|
||||||
imapClient: imapClientStub,
|
imapClient: imapClientStub,
|
||||||
@ -337,7 +332,6 @@ define(function(require) {
|
|||||||
it('should work when folder not yet initiated', function(done) {
|
it('should work when folder not yet initiated', function(done) {
|
||||||
var folders = [];
|
var folders = [];
|
||||||
imapLoginStub.yields();
|
imapLoginStub.yields();
|
||||||
pgpmailerLoginStub.returns();
|
|
||||||
imapListFoldersStub.yields(null, folders);
|
imapListFoldersStub.yields(null, folders);
|
||||||
|
|
||||||
dao.onConnect({
|
dao.onConnect({
|
||||||
@ -488,20 +482,6 @@ define(function(require) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('_pgpmailerLogin', function() {
|
|
||||||
it('should work', function() {
|
|
||||||
// called once in onConnect
|
|
||||||
expect(pgpMailerStub.login.calledOnce).to.be.true;
|
|
||||||
|
|
||||||
pgpMailerStub.login.returns();
|
|
||||||
|
|
||||||
dao._pgpmailerLogin();
|
|
||||||
|
|
||||||
expect(pgpMailerStub.login.calledTwice).to.be.true;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
describe('_imapLogin', function() {
|
describe('_imapLogin', function() {
|
||||||
it('should fail when disconnected', function(done) {
|
it('should fail when disconnected', function(done) {
|
||||||
dao.onDisconnect(null, function(err) {
|
dao.onDisconnect(null, function(err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user