From 36a9354b49062a8eb8c2737d8580f38d17391642 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Thu, 28 Jan 2016 10:45:52 +0100 Subject: Add original attachments to forwared mails - Issue #579 --- web-ui/app/js/mail_view/ui/forward_box.js | 1 + web-ui/test/spec/mail_view/ui/forward_box.spec.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'web-ui') diff --git a/web-ui/app/js/mail_view/ui/forward_box.js b/web-ui/app/js/mail_view/ui/forward_box.js index 2f848430..a1b8dc41 100644 --- a/web-ui/app/js/mail_view/ui/forward_box.js +++ b/web-ui/app/js/mail_view/ui/forward_box.js @@ -40,6 +40,7 @@ define( this.setupForwardBox = function() { var mail = this.attr.mail; this.attr.subject = fwd(mail.header.subject); + this.attr.attachments = mail.attachments; this.renderInlineCompose('forward-box', { subject: this.attr.subject, diff --git a/web-ui/test/spec/mail_view/ui/forward_box.spec.js b/web-ui/test/spec/mail_view/ui/forward_box.spec.js index 613baa47..de6a6b0d 100644 --- a/web-ui/test/spec/mail_view/ui/forward_box.spec.js +++ b/web-ui/test/spec/mail_view/ui/forward_box.spec.js @@ -78,6 +78,20 @@ describeComponent('mail_view/ui/forward_box', function () { })); }); + it('should copy original message attachments', function() { + testMail = Pixelated.testData().parsedMail.withAttachments; + var mailSendEvent = spyOnEvent(document, Pixelated.events.mail.send); + + this.setupComponent({ mail: testMail }); + + this.component.attr.recipientValues.to.push('forward_to@email.com'); + $(document).trigger(Pixelated.events.ui.mail.send); + + var sentMail = mailSendEvent.mostRecentCall.data; + + expect(sentMail.attachments).toEqual(testMail.attachments); + }); + it('triggers openMail when email is sent', function() { var eventSpy = spyOnEvent(document, Pixelated.events.ui.mail.open); this.setupComponent({ mail: testMail }); -- cgit v1.2.3