mirror of
https://github.com/moparisthebest/mail
synced 2024-11-26 02:42:17 -05:00
add move
This commit is contained in:
parent
4ff88694d4
commit
8e88ae7f99
@ -500,6 +500,14 @@ define(function(require) {
|
|||||||
}, callback);
|
}, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
EmailDAO.prototype.move = function(options, callback) {
|
||||||
|
this._imapClient.moveMessage({
|
||||||
|
path: options.folder,
|
||||||
|
uid: options.uid,
|
||||||
|
destination: options.destination
|
||||||
|
}, callback);
|
||||||
|
};
|
||||||
|
|
||||||
EmailDAO.prototype.sendEncrypted = function(options, callback) {
|
EmailDAO.prototype.sendEncrypted = function(options, callback) {
|
||||||
var self = this,
|
var self = this,
|
||||||
email = options.email;
|
email = options.email;
|
||||||
|
@ -1139,7 +1139,11 @@ define(function(require) {
|
|||||||
|
|
||||||
describe('markAsRead', function() {
|
describe('markAsRead', function() {
|
||||||
it('should work', function(done) {
|
it('should work', function(done) {
|
||||||
imapClientStub.updateFlags.yields();
|
imapClientStub.updateFlags.withArgs({
|
||||||
|
path: 'asdf',
|
||||||
|
uid: 1,
|
||||||
|
unread: false
|
||||||
|
}).yields();
|
||||||
|
|
||||||
dao.markRead({
|
dao.markRead({
|
||||||
folder: 'asdf',
|
folder: 'asdf',
|
||||||
@ -1154,7 +1158,11 @@ define(function(require) {
|
|||||||
|
|
||||||
describe('markAsAnswered', function() {
|
describe('markAsAnswered', function() {
|
||||||
it('should work', function(done) {
|
it('should work', function(done) {
|
||||||
imapClientStub.updateFlags.yields();
|
imapClientStub.updateFlags.withArgs({
|
||||||
|
path: 'asdf',
|
||||||
|
uid: 1,
|
||||||
|
answered: true
|
||||||
|
}).yields();
|
||||||
|
|
||||||
dao.markAnswered({
|
dao.markAnswered({
|
||||||
folder: 'asdf',
|
folder: 'asdf',
|
||||||
@ -1167,6 +1175,26 @@ define(function(require) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('move', function() {
|
||||||
|
it('should work', function(done) {
|
||||||
|
imapClientStub.moveMessage.withArgs({
|
||||||
|
path: 'asdf',
|
||||||
|
uid: 1,
|
||||||
|
destination: 'asdasd'
|
||||||
|
}).yields();
|
||||||
|
|
||||||
|
dao.move({
|
||||||
|
folder: 'asdf',
|
||||||
|
uid: 1,
|
||||||
|
destination: 'asdasd'
|
||||||
|
}, function(err) {
|
||||||
|
expect(imapClientStub.moveMessage.calledOnce).to.be.true;
|
||||||
|
expect(err).to.not.exist;
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('sendPlaintext', function() {
|
describe('sendPlaintext', function() {
|
||||||
it('should work', function(done) {
|
it('should work', function(done) {
|
||||||
smtpClientStub.send.withArgs(dummyEncryptedMail).yields();
|
smtpClientStub.send.withArgs(dummyEncryptedMail).yields();
|
||||||
|
Loading…
Reference in New Issue
Block a user