fix: email testing and settings change from ACP

- changing email SMTP settings wouldn't apply the first time
- "Send Test Email" now will report emailer errors in most cases
This commit is contained in:
Peter Jaszkowiak
2020-12-05 14:25:14 -07:00
committed by Julian Lam
parent 713f029dc8
commit 2be396ff6e
16 changed files with 114 additions and 85 deletions

View File

@@ -68,9 +68,13 @@ describe('API', async () => {
async function dummySearchHook(data) {
return [1];
}
async function dummyEmailerHook(data) {
// pretend to handle sending emails
}
after(async function () {
plugins.unregisterHook('core', 'filter:search.query', dummySearchHook);
plugins.unregisterHook('emailer-test', 'filter:email.send');
});
async function setupData() {
@@ -145,6 +149,11 @@ describe('API', async () => {
hook: 'filter:search.query',
method: dummySearchHook,
});
// Attach an emailer hook so related requests do not error
plugins.registerHook('emailer-test', {
hook: 'filter:email.send',
method: dummyEmailerHook,
});
jar = await helpers.loginUser('admin', '123456');