mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-28 19:31:14 +08:00
fix(extensions): Add missing return values
This commit is contained in:
parent
9530a84877
commit
d12e4fdc81
2 changed files with 8 additions and 4 deletions
|
@ -129,10 +129,12 @@ describe('ComposerExtensionAdapter', ()=> {
|
|||
const extension = {
|
||||
finalizeSessionBeforeSending(sess) {
|
||||
methodSpy(sess);
|
||||
return 'result';
|
||||
},
|
||||
};
|
||||
adapter.adaptComposerMethod(extension, 'finalizeSessionBeforeSending');
|
||||
extension.finalizeSessionBeforeSending({session});
|
||||
const res = extension.finalizeSessionBeforeSending({session});
|
||||
expect(res).toEqual('result');
|
||||
expect(methodSpy).toHaveBeenCalledWith(session);
|
||||
});
|
||||
|
||||
|
@ -142,10 +144,12 @@ describe('ComposerExtensionAdapter', ()=> {
|
|||
const extension = {
|
||||
warningsForSending(dr) {
|
||||
methodSpy(dr);
|
||||
return 'result';
|
||||
},
|
||||
};
|
||||
adapter.adaptComposerMethod(extension, 'warningsForSending');
|
||||
extension.warningsForSending({draft});
|
||||
const res = extension.warningsForSending({draft});
|
||||
expect(res).toEqual('result');
|
||||
expect(methodSpy).toHaveBeenCalledWith(draft);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -29,11 +29,11 @@ export function adaptComposerMethod(extension, method) {
|
|||
|
||||
if (method === 'finalizeSessionBeforeSending') {
|
||||
extension[method] = (argsObj)=> {
|
||||
original(argsObj.session);
|
||||
return original(argsObj.session);
|
||||
};
|
||||
} else {
|
||||
extension[method] = (argsObj)=> {
|
||||
original(argsObj.draft);
|
||||
return original(argsObj.draft);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue