From 32fe00c7b23883a0ce35910537cb1966457624cb Mon Sep 17 00:00:00 2001 From: Alexandre Pretto Nunes Date: Fri, 19 Dec 2014 17:53:52 -0200 Subject: #81 Fix checking if any mail is marked when on 'all' tag --- web-ui/test/spec/mail_list/ui/mail_list.spec.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'web-ui/test/spec/mail_list') 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); -- cgit v1.2.3