From a222f811d07846dfdbeac963fa753fedbd88c13a Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Thu, 5 Nov 2015 17:12:44 +0100 Subject: Add no mails availabe message to middle pane - Issue #503 --- .../dispatchers/middle_pane_dispatchers.spec.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js') diff --git a/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js b/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js index 997c51f2..265e1d4f 100644 --- a/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js +++ b/web-ui/test/spec/dispatchers/middle_pane_dispatchers.spec.js @@ -22,4 +22,30 @@ describeComponent('dispatchers/middle_pane_dispatcher', function () { this.component.trigger(document, Pixelated.events.dispatchers.middlePane.resetScroll); expect(this.component.select('middlePane').scrollTop()).toEqual(0); }); + + describe('no emails available', function () { + var noMailsAvailablePane; + beforeEach(function () { + noMailsAvailablePane = require('mail_view/ui/no_mails_available_pane'); + spyOn(noMailsAvailablePane, 'attachTo'); + spyOn(noMailsAvailablePane, 'teardownAll'); + }); + + it('should listen to no mails available event and show noMailsAvailablePane', function () { + var mail_list = { mails: []}; + this.component.trigger(document, Pixelated.events.mails.available, mail_list); + + expect(noMailsAvailablePane.attachTo).toHaveBeenCalled(); + }); + + it('should tbd', function () { + var pretend_to_be_a_mail = {}; + var mail_list = { mails: [pretend_to_be_a_mail]}; + this.component.trigger(document, Pixelated.events.mails.available, mail_list); + + expect(noMailsAvailablePane.attachTo).not.toHaveBeenCalled(); + expect(noMailsAvailablePane.teardownAll).toHaveBeenCalled(); + }); + + }); }); -- cgit v1.2.3