mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) move apiserver tests to core, disentangling notifier+billing parts
Summary: This moves some more tests to core that would be useful for ANCT, which had been stuck in grist-saas due to some entanglements with sendgrid and billing. For sendgrid, I've moved around just enough material to permit the tests to run mostly unchanged. Ideally the interface to a notification system would be generalized, but that's a bigger project. Test Plan: checked that tests are likely to run as expected in core using preview laid out by ./buildtools/build_core.sh Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D4149
This commit is contained in:
@@ -97,6 +97,7 @@ export function makeSimpleCreator(opts: {
|
||||
return notifier?.create(dbManager, gristConfig) ?? {
|
||||
get testPending() { return false; },
|
||||
async deleteUser() { /* do nothing */ },
|
||||
testSetSendMessageCallback() { return undefined; },
|
||||
};
|
||||
},
|
||||
ExternalStorage(purpose, extraPrefix) {
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import {SendGridConfig, SendGridMail} from 'app/gen-server/lib/NotifierTypes';
|
||||
|
||||
export interface INotifier {
|
||||
// for test purposes, check if any notifications are in progress
|
||||
readonly testPending: boolean;
|
||||
|
||||
deleteUser(userId: number): Promise<void>;
|
||||
|
||||
// Intercept outgoing messages for test purposes.
|
||||
// Return undefined if no notification system is available.
|
||||
testSetSendMessageCallback(op: (body: SendGridMail, description: string) => Promise<void>): SendGridConfig|undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user