summaryrefslogtreecommitdiff
path: root/web-ui/test
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-12-29 15:52:39 -0200
committerGiovane <giovaneliberato@gmail.com>2015-12-29 15:52:39 -0200
commit5dca3fda432c12cd63ab4c8011aa2ea74ce1a771 (patch)
treeb6bb52d9304b56ddeb1a99230963549746d3256b /web-ui/test
parent32e625a9389bc7352c911ebc5db289647db3ba66 (diff)
Shows selected tag in addition of unread count #564
Diffstat (limited to 'web-ui/test')
-rw-r--r--web-ui/test/spec/page/unread_count_title.spec.js28
1 files changed, 13 insertions, 15 deletions
diff --git a/web-ui/test/spec/page/unread_count_title.spec.js b/web-ui/test/spec/page/unread_count_title.spec.js
index 0291c1db..e367e579 100644
--- a/web-ui/test/spec/page/unread_count_title.spec.js
+++ b/web-ui/test/spec/page/unread_count_title.spec.js
@@ -9,41 +9,39 @@ describeComponent('page/unread_count_title', function () {
});
it('listens to mails available event', function () {
- this.component.trigger(Pixelated.events.mails.available, {mails: []});
- expect(this.component.getTitleText()).toEqual('example@pixelated-project.org');
+ this.component.trigger(Pixelated.events.mails.available, {mails: [], tag: 'inbox'});
+ expect(this.component.getTitleText()).toEqual('Inbox - example@pixelated-project.org');
});
it('only considers unread mails', function () {
var readMail = {'status': ['read']};
- this.component.trigger(Pixelated.events.mails.available, {mails: [readMail]});
- expect(this.component.getTitleText()).toEqual('example@pixelated-project.org');
+ this.component.trigger(Pixelated.events.mails.available, {mails: [readMail], tag: 'inbox'});
+ expect(this.component.getTitleText()).toEqual('Inbox - example@pixelated-project.org');
});
it('update for one unread email', function () {
var mails = [{'status': ['read']}, {'status': []}];
- this.component.trigger(Pixelated.events.mails.available, {mails: mails});
- expect(this.component.getTitleText()).toEqual('(1) - example@pixelated-project.org');
+ this.component.trigger(Pixelated.events.mails.available, {mails: mails, tag: 'inbox'});
+ expect(this.component.getTitleText()).toEqual('Inbox (1) - example@pixelated-project.org');
});
it('update for more than one unread email', function () {
var mails = [{'status': ['read']}, {'status': []}, {'status': []}];
- this.component.trigger(Pixelated.events.mails.available, {mails: mails});
- expect(this.component.getTitleText()).toEqual('(2) - example@pixelated-project.org');
+ this.component.trigger(Pixelated.events.mails.available, {mails: mails, tag: 'inbox'});
+ expect(this.component.getTitleText()).toEqual('Inbox (2) - example@pixelated-project.org');
});
it('update for more than one unread email', function () {
var mails = [{'status': ['read']}, {'status': []}, {'status': []}];
- this.component.trigger(Pixelated.events.mails.available, {mails: mails});
- expect(this.component.getTitleText()).toEqual('(2) - example@pixelated-project.org');
+ this.component.trigger(Pixelated.events.mails.available, {mails: mails, tag: 'inbox'});
+ expect(this.component.getTitleText()).toEqual('Inbox (2) - example@pixelated-project.org');
});
it('decreases unread count', function () {
- document.title = '(2) - example@pixelated-project.org';
+ document.title = 'Inbox (2) - example@pixelated-project.org';
var mails = [{'status': ['read']}, {'status': ['read']}];
- this.component.trigger(Pixelated.events.mails.available, {mails: mails});
- expect(this.component.getTitleText()).toEqual('example@pixelated-project.org');
+ this.component.trigger(Pixelated.events.mails.available, {mails: mails, tag: 'inbox'});
+ expect(this.component.getTitleText()).toEqual('Inbox - example@pixelated-project.org');
});
-
-
});
});