From 14f0e57ccbda82206cd8149018b306c6f17032d9 Mon Sep 17 00:00:00 2001 From: Giovane Date: Tue, 1 Dec 2015 23:04:34 -0200 Subject: Shows unread count on title bar - This commit creates the unread_count_title component --- web-ui/test/spec/page/unread_count_title.spec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 web-ui/test/spec/page/unread_count_title.spec.js (limited to 'web-ui/test/spec/page') diff --git a/web-ui/test/spec/page/unread_count_title.spec.js b/web-ui/test/spec/page/unread_count_title.spec.js new file mode 100644 index 00000000..ce49c48b --- /dev/null +++ b/web-ui/test/spec/page/unread_count_title.spec.js @@ -0,0 +1,21 @@ + +describeComponent('page/unread_count_title', function () { + 'use strict'; + describe('title bar', function () { + beforeEach(function () { + this.setupComponent(''); + }); + + it('should render template', function () { + expect(this.$node).toExist(); + expect(this.$node.html()).toEqual('(1)'); + }); + + it('should update count on mail read event', function () { + this.component.trigger(Pixelated.events.mails.read); + $(document).trigger(Pixelated.events.mail.read, { tags: ['someothertag'], mailbox: 'inbox' }); + expect(this.$node.html()).toEqual('(1)'); + }); + + }); +}); -- cgit v1.2.3