summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web-ui/app/js/mail_view/ui/forward_box.js1
-rw-r--r--web-ui/test/spec/mail_view/ui/forward_box.spec.js14
2 files changed, 15 insertions, 0 deletions
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 });