diff options
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/spec/page/unread_count_title.spec.js | 28 |
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'); }); - - }); }); |