mirror of
https://github.com/moparisthebest/mail
synced 2024-12-22 15:28:49 -05:00
[WO-390] include attachments in forwarded message
This commit is contained in:
parent
bb84da4324
commit
48b394f3bd
@ -98,6 +98,13 @@ define(function(require) {
|
||||
$scope.cc.forEach($scope.verify);
|
||||
}
|
||||
|
||||
// fill attachments on forward
|
||||
if (forward) {
|
||||
// create a new array, otherwise removing an attachment will also
|
||||
// remove it from the original in the mail list as a side effect
|
||||
$scope.attachments = [].concat(re.attachments);
|
||||
}
|
||||
|
||||
// fill subject
|
||||
if (forward) {
|
||||
$scope.subject = 'Fwd: ' + re.subject;
|
||||
|
@ -124,6 +124,40 @@ define(function(require) {
|
||||
scope.verify.restore();
|
||||
});
|
||||
|
||||
it('should prefill write view for forward', function() {
|
||||
var verifyMock = sinon.stub(scope, 'verify'),
|
||||
address = 'pity@dafool',
|
||||
subject = 'Ermahgerd!',
|
||||
body = 'so much body!',
|
||||
re = {
|
||||
from: [{
|
||||
address: address
|
||||
}],
|
||||
to: [{
|
||||
address: address
|
||||
}],
|
||||
subject: subject,
|
||||
sentDate: new Date(),
|
||||
body: body,
|
||||
attachments: [{}]
|
||||
};
|
||||
|
||||
scope.state.writer.write(re, null, true);
|
||||
|
||||
expect(scope.writerTitle).to.equal('Forward');
|
||||
expect(scope.to).to.deep.equal([{
|
||||
address: ''
|
||||
}]);
|
||||
expect(scope.subject).to.equal('Fwd: ' + subject);
|
||||
expect(scope.body).to.contain(body);
|
||||
expect(scope.ciphertextPreview).to.not.be.empty;
|
||||
expect(verifyMock.called).to.be.true;
|
||||
expect(scope.attachments).to.not.equal(re.attachments); // not the same reference
|
||||
expect(scope.attachments).to.deep.equal(re.attachments); // but the same content
|
||||
|
||||
scope.verify.restore();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('onAddressUpdate', function() {
|
||||
|
Loading…
Reference in New Issue
Block a user