summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/mail_list
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-16 14:59:49 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-16 14:59:56 +0200
commit5a0425986800bf03de8c49dc00f45d86d3b365ee (patch)
tree967bdd7868d67adaf1967f9616ef6a1702d5fa6f /web-ui/test/spec/mail_list
parent2871fd91a844e007cbf821b51f6bba16cf727abb (diff)
for #95, make sure that the tag list is also refreshed when the mail list is refreshed, since there can be new unread mails and we need to update the count
Diffstat (limited to 'web-ui/test/spec/mail_list')
-rw-r--r--web-ui/test/spec/mail_list/ui/mail_list.spec.js15
1 files changed, 14 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 11993ba1..9c01c6af 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
@@ -166,11 +166,14 @@ describeComponent('mail_list/ui/mail_list', function () {
});
- it('should render all mails sent in ui:mails:show event', function () {
+ it('should render all mails sent in ui:mails:show event but shouldnt refresh the tags', function () {
+ var refreshTagListEvent = spyOnEvent(document, Pixelated.events.dispatchers.tags.refreshTagList);
+
this.component.$node.trigger(Pixelated.events.mails.available, { mails: mailList });
matchMail(mailList[0], this.component.$node);
matchMail(mailList[1], this.component.$node);
+ expect(refreshTagListEvent).not.toHaveBeenTriggeredOn(document);
});
it('should select the current email when mails are available', function () {
@@ -259,6 +262,16 @@ describeComponent('mail_list/ui/mail_list', function () {
});
});
+ describe('refreshing the mail list', function () {
+ it('also refreshes the tag list but skips the next mail list refresh', function () {
+ var tagListRefreshEvent = spyOnEvent(document, Pixelated.events.dispatchers.tags.refreshTagList);
+
+ $(document).trigger(Pixelated.events.mails.availableForRefresh, { mails: []});
+
+ expect(tagListRefreshEvent).toHaveBeenTriggeredOnAndWith(document, { skipMailListRefresh: true});
+ });
+ });
+
function createMail(subject, from, ident, date) {
var mail = Pixelated.testData().parsedMail.simpleTextPlain;