mirror of
https://github.com/moparisthebest/mail
synced 2024-11-22 08:52:15 -05:00
reactivate push in email dao
This commit is contained in:
parent
e53e9e560e
commit
78453fd416
@ -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);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user