summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_list
diff options
context:
space:
mode:
authorAlexandre Pretto Nunes <anunes@thoughtworks.com>2014-12-19 17:53:52 -0200
committerAlexandre Pretto Nunes <anunes@thoughtworks.com>2014-12-19 17:53:52 -0200
commit32fe00c7b23883a0ce35910537cb1966457624cb (patch)
treeca700d58f3a14c4ddb9fa2e2e63f87facb23bcf9 /web-ui/test/spec/mail_list
parent878ee42e6a4ee40c1f7e3ff537dd3bf21a76368f (diff)
#81 Fix checking if any mail is marked when on 'all' tag
Diffstat (limited to 'web-ui/test/spec/mail_list')
-rw-r--r--web-ui/test/spec/mail_list/ui/mail_list.spec.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/web-ui/test/spec/mail_list/ui/mail_list.spec.js b/web-ui/test/spec/mail_list/ui/mail_list.spec.js
index 5c285110..003830de 100644
--- a/web-ui/test/spec/mail_list/ui/mail_list.spec.js
+++ b/web-ui/test/spec/mail_list/ui/mail_list.spec.js
@@ -75,7 +75,18 @@ describeComponent('mail_list/ui/mail_list', function () {
it('returns the list of checked mails based on the current tag to whomever requests them', function () {
var caller = {};
this.component.attr.checkedMails = mailList;
- this.component.attr.currentTag = 'inbox';
+ this.component.attr.currentTag = 'inbox';
+ var mailHereCheckedEvent = spyOnEvent(caller, Pixelated.events.ui.mail.hereChecked);
+
+ $(document).trigger(Pixelated.events.ui.mail.wantChecked, caller);
+
+ expect(mailHereCheckedEvent).toHaveBeenTriggeredOnAndWith(caller, { checkedMails: mailList });
+ });
+
+ it('returns every checked mail when the curent tag is "all"', function () {
+ var caller = {};
+ this.component.attr.checkedMails = mailList;
+ this.component.attr.currentTag = 'all';
var mailHereCheckedEvent = spyOnEvent(caller, Pixelated.events.ui.mail.hereChecked);
$(document).trigger(Pixelated.events.ui.mail.wantChecked, caller);