summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorAlexandre Pretto Nunes <anunes@thoughtworks.com>2014-12-22 15:47:05 -0200
committerAlexandre Pretto Nunes <anunes@thoughtworks.com>2014-12-22 15:47:15 -0200
commit88ed5d5ec169b21a9a21b82ba475efb94894c3dd (patch)
tree011ec7360018201ff4ff6c3cc1631f823707d054 /web-ui/test
parent41598e6e9333e5887048956f4e56e97e35fa5924 (diff)
#202 fix identification if mail is in trash
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/spec/services/model/mail.spec.js7
-rw-r--r--web-ui/test/test_data.js17
2 files changed, 22 insertions, 2 deletions
diff --git a/web-ui/test/spec/services/model/mail.spec.js b/web-ui/test/spec/services/model/mail.spec.js
index 53ac0845..35c4bc9b 100644
--- a/web-ui/test/spec/services/model/mail.spec.js
+++ b/web-ui/test/spec/services/model/mail.spec.js
@@ -6,10 +6,11 @@ require(['services/model/mail'], function (Mail) {
describe('services/model/mail', function () {
describe('parsing', function () {
describe('a single email', function () {
- var sentMail, draftMail, receivedMail, receivedMailWithCC, rawMailWithMultipleTo;
+ var sentMail, draftMail, receivedMail, receivedMailWithCC, rawMailWithMultipleTo, mailInTrash;
beforeEach(function () {
sentMail = Mail.create(Pixelated.testData().rawMail.sent);
draftMail = Mail.create(Pixelated.testData().rawMail.draft);
+ mailInTrash = Mail.create(Pixelated.testData().rawMail.trash);
receivedMail = Mail.create(Pixelated.testData().rawMail.received);
receivedMailWithCC = Mail.create(Pixelated.testData().rawMail.receivedWithCC);
rawMailWithMultipleTo = Mail.create(Pixelated.testData().rawMail.rawMailWithMultipleTo);
@@ -27,6 +28,10 @@ require(['services/model/mail'], function (Mail) {
expect(receivedMail.isSentMail()).toBe(false);
expect(receivedMail.isDraftMail()).toBe(false);
});
+
+ it('correctly identifies a mail in trash', function () {
+ expect(mailInTrash.isInTrash()).toBe(true);
+ });
});
describe('multipart email', function () {
diff --git a/web-ui/test/test_data.js b/web-ui/test/test_data.js
index f83a807c..20b6ee0f 100644
--- a/web-ui/test/test_data.js
+++ b/web-ui/test/test_data.js
@@ -40,7 +40,6 @@ define(function() {
'cc-field': ['duda@la.lu']
}
}
-
};
var rawDraftMail = {
@@ -57,7 +56,22 @@ define(function() {
'cc-field': []
}
}
+ };
+ var rawMailInTrash = {
+ 'header':{'to':'mariane_dach@davis.info','from':'afton_braun@botsford.biz','subject':'Consectetur sit omnis veniam blanditiis.','date':'2014-06-17T11:56:53-03:00'},
+ 'ident':9360,
+ 'tags':['photography','sky'],
+ 'status':['read'],
+ 'body':'Illum eos nihil commodi voluptas. Velit consequatur odio quibusdam. Beatae aliquam hic quos.',
+ 'mailbox': 'TRASH',
+ replying: {
+ single: 'afton_braun@botsford.biz',
+ all: {
+ 'to-field': ['afton_braun@botsford.biz'],
+ 'cc-field': []
+ }
+ }
};
var rawReceivedMail = {
@@ -219,6 +233,7 @@ define(function() {
mail: rawMail,
sent: rawSentMail,
draft: rawDraftMail,
+ trash: rawMailInTrash,
received: rawReceivedMail,
receivedWithCC: rawReceivedWithCCMail,
rawMailWithMultipleTo: rawMailWithMultipleTo,