1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-22 08:52:15 -05:00

Merge pull request #157 from whiteout-io/dev/WO-660

[WO-660] Add \Flagged to message flags
This commit is contained in:
Tankred Hase 2014-11-06 16:13:54 +01:00
commit 8cc84ef8c6
9 changed files with 24 additions and 15 deletions

View File

@ -37,7 +37,7 @@
"axe-logger": "~0.0.2",
"crypto-lib": "~0.2.1",
"dompurify": "~0.4.2",
"imap-client": "~0.5.0",
"imap-client": "~0.6.0",
"jquery": "~2.1.1",
"mailreader": "~0.4.0",
"ng-infinite-scroll": "~1.1.2",
@ -48,7 +48,7 @@
"angularjs": "https://github.com/whiteout-io/angular.js/tarball/npm-version",
"browsercrow": "https://github.com/whiteout-io/browsercrow/tarball/master",
"browsersmtp": "https://github.com/whiteout-io/browsersmtp/tarball/master",
"chai": "~1.7.2",
"chai": "~1.9.2",
"grunt": "~0.4.1",
"grunt-browserify": "^3.0.1",
"grunt-contrib-clean": "~0.5.0",
@ -72,4 +72,4 @@
"grunt-svgmin": "~1.0.0",
"grunt-svgstore": "~0.3.4"
}
}
}

View File

@ -545,7 +545,8 @@ EmailDAO.prototype.setFlags = function(options, callback) {
folder: folder,
uid: options.message.uid,
unread: options.message.unread,
answered: options.message.answered
answered: options.message.answered,
flagged: options.message.flagged
}, function(err) {
if (err) {
done(err);
@ -572,6 +573,7 @@ EmailDAO.prototype.setFlags = function(options, callback) {
// set the flags
var storedMessage = storedMessages[0];
storedMessage.unread = options.message.unread;
storedMessage.flagged = options.message.flagged;
storedMessage.answered = options.message.answered;
storedMessage.modseq = options.message.modseq || storedMessage.modseq;

View File

@ -14,7 +14,7 @@ var ImapClient = require('imap-client'),
describe('Email DAO integration tests', function() {
this.timeout(100000);
chai.Assertion.includeStack = true;
chai.config.includeStack = true;
var emailDao, imapClient, imapMessages, imapFolders, imapServer, smtpServer, smtpClient, userStorage,
mockKeyPair, inbox, spam;
@ -321,11 +321,13 @@ describe('Email DAO integration tests', function() {
it('should receive new messages', function(done) {
emailDao.onIncomingMessage = function(messages) {
expect(messages.length).to.equal(1);
expect(messages[0].answered).to.be.false;
expect(messages[0].answered).to.be.true;
expect(messages[0].flagged).to.be.true;
expect(messages[0].unread).to.be.false;
done();
};
imapServer.appendMessage('INBOX', ['$My$Flag'], false, 'Message-id: <n1>\r\nSubject: new message\r\n\r\nhello world!');
imapServer.appendMessage('INBOX', ['\\Flagged', '\\Seen', '\\Answered'], false, 'Message-id: <n1>\r\nSubject: new message\r\n\r\nhello world!');
});
it('should delete a message', function(done) {
@ -391,6 +393,7 @@ describe('Email DAO integration tests', function() {
var message = inbox.messages[1];
message.unread = false;
message.answered = true;
message.flagged = true;
emailDao.setFlags({
folder: inbox,

View File

@ -47,4 +47,7 @@ if (!Function.prototype.bind) {
})();
// set worker path for tests
require('../src/js/app-config').config.workerPath = '../lib';
require('../src/js/app-config').config.workerPath = '../lib';
var axe = require('axe-logger');
axe.removeAppender(axe.defaultAppender);

View File

@ -3,7 +3,7 @@
var btnHandler = require('../../src/js/util/backbutton-handler');
describe('Backbutton Handler', function() {
chai.Assertion.includeStack = true;
chai.config.includeStack = true;
var scope, event;

View File

@ -13,7 +13,7 @@ var mailreader = require('mailreader'),
describe('Email DAO unit tests', function() {
// show the stack trace when an error occurred
chai.Assertion.includeStack = true;
chai.config.includeStack = true;
// SUT
var dao;
@ -717,7 +717,8 @@ describe('Email DAO unit tests', function() {
folder: inboxFolder,
uid: message.uid,
unread: message.unread,
answered: message.answered
answered: message.answered,
flagged: message.flagged
}).yieldsAsync();
localListStub.withArgs({

View File

@ -8,7 +8,7 @@ var mocks = angular.mock,
appController = require('../../src/js/app-controller'),
notification = require('../../src/js/util/notification');
chai.Assertion.includeStack = true;
chai.config.includeStack = true;
describe('Mail List controller unit test', function() {
var scope, ctrl, origEmailDao, emailDaoMock, keychainMock, deviceStorageMock,

View File

@ -5,12 +5,12 @@ var OutboxBO = require('../../src/js/bo/outbox'),
EmailDAO = require('../../src/js/dao/email-dao'),
DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao');
chai.Assertion.includeStack = true;
describe('Outbox Business Object unit test', function() {
var outbox, emailDaoStub, devicestorageStub, keychainStub,
dummyUser = 'spiderpig@springfield.com';
chai.config.includeStack = true;
beforeEach(function() {
emailDaoStub = sinon.createStubInstance(EmailDAO);
emailDaoStub._account = {

View File

@ -9,7 +9,7 @@ var DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao'),
describe('UpdateHandler', function() {
var updateHandler, appConfigStorageStub, authStub, userStorageStub, origDbVersion;
chai.Assertion.includeStack = true;
chai.config.includeStack = true;
beforeEach(function() {
origDbVersion = cfg.dbVersion;