1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 17:02:17 -05:00

reactivate push in email dao

This commit is contained in:
Felix Hammerl 2013-12-04 12:06:27 +01:00
parent e53e9e560e
commit 78453fd416
2 changed files with 20 additions and 7 deletions

View File

@ -15,12 +15,12 @@ define(function(require) {
self._crypto = crypto;
self._devicestorage = devicestorage;
// // delegation-esque pattern to mitigate between node-style events and plain js
// self._imapClient.onIncomingMessage = function(message) {
// if (typeof self.onIncomingMessage === 'function') {
// self.onIncomingMessage(message);
// }
// };
// delegation-esque pattern to mitigate between node-style events and plain js
self._imapClient.onIncomingMessage = function(message) {
if (typeof self.onIncomingMessage === 'function') {
self.onIncomingMessage(message);
}
};
};
//

View File

@ -10,7 +10,7 @@ define(function(require) {
expect = chai.expect;
describe('Email DAO 2 unit tests', function() {
describe('Email DAO unit tests', function() {
var dao, keychainStub, imapClientStub, smtpClientStub, pgpStub, devicestorageStub;
var emailAddress, passphrase, asymKeySize, mockkeyId, dummyEncryptedMail,
@ -105,6 +105,19 @@ define(function(require) {
afterEach(function() {});
describe('push', function() {
it('should work', function(done) {
var o = {};
dao.onIncomingMessage = function(obj) {
expect(obj).to.equal(o);
done();
};
dao._imapClient.onIncomingMessage(o);
});
});
describe('init', function() {
beforeEach(function() {
delete dao._account;