diff options
author | Jon Newson <jon_newson@ieee.org> | 2016-03-04 10:37:14 +1100 |
---|---|---|
committer | Jon Newson <jon_newson@ieee.org> | 2016-03-04 10:37:14 +1100 |
commit | 9f467ef8bfd85921d310976e8554af119f7f0341 (patch) | |
tree | 633426e43c5613c801ce14b340bc616b56762f5e /web-ui/test | |
parent | 2662e78497ce527467556a15c3cc9b20f84929ba (diff) | |
parent | 59532a50c8b0233b2a596b996cbe799b745c4fac (diff) |
Merge branch 'master' of https://github.com/pixelated/pixelated-user-agent
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/spec/mail_view/ui/mail_view.spec.js | 5 | ||||
-rw-r--r-- | web-ui/test/spec/mail_view/ui/reply_section.spec.js | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/web-ui/test/spec/mail_view/ui/mail_view.spec.js b/web-ui/test/spec/mail_view/ui/mail_view.spec.js index ae874621..9ed56023 100644 --- a/web-ui/test/spec/mail_view/ui/mail_view.spec.js +++ b/web-ui/test/spec/mail_view/ui/mail_view.spec.js @@ -29,6 +29,11 @@ describeComponent('mail_view/ui/mail_view', function () { expect(openNoMessageSelectedEvent).toHaveBeenTriggeredOn(document); }); + it('should open reply container', function () { + var showContainerEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyContainer); + this.component.displayMail({}, testData); + expect(showContainerEvent).toHaveBeenTriggeredOn(document); + }); it('removes the tag from the mail when the tag label is clicked', function() { var updateSpy = spyOnEvent(document, Pixelated.events.mail.tags.update); diff --git a/web-ui/test/spec/mail_view/ui/reply_section.spec.js b/web-ui/test/spec/mail_view/ui/reply_section.spec.js index 9cdf7405..00709684 100644 --- a/web-ui/test/spec/mail_view/ui/reply_section.spec.js +++ b/web-ui/test/spec/mail_view/ui/reply_section.spec.js @@ -5,6 +5,18 @@ describeComponent('mail_view/ui/reply_section', function () { this.setupComponent(); }); + describe('show/hide reply container', function () { + it('should hide reply container until mail data is loaded', function () { + this.component.checkForDraftReply(); + expect(this.component.select('replyContainer')).toBeHidden(); + }); + + it('should show reply container when mail data is loaded', function () { + this.component.trigger(document, Pixelated.events.ui.replyBox.showReplyContainer); + expect(this.component.select('replyContainer')).not.toBeHidden(); + }); + }); + describe('clicking reply buttons', function() { var mailWantEvent, expectEventData; @@ -45,6 +57,7 @@ describeComponent('mail_view/ui/reply_section', function () { this.component.attr.replyType = 'reply'; this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData, replyType: 'reply' @@ -55,6 +68,7 @@ describeComponent('mail_view/ui/reply_section', function () { this.component.attr.replyType = 'replyall'; this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData, replyType: 'replyall' @@ -65,6 +79,7 @@ describeComponent('mail_view/ui/reply_section', function () { this.component.attr.replyType = 'forward'; this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(ForwardBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData }); @@ -87,6 +102,7 @@ describeComponent('mail_view/ui/reply_section', function () { $(document).trigger(Pixelated.events.ui.composeBox.trashReply); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(this.component.select('replyButton')).not.toBeHidden(); expect(this.component.select('replyAllButton')).not.toBeHidden(); expect(this.component.select('forwardButton')).not.toBeHidden(); |