mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
feat(server): new email template (#9528)
use `yarn af server dev:mail` to preview all mail template fix CLOUD-93
This commit is contained in:
@@ -24,7 +24,10 @@ test.before(async t => {
|
||||
imports: [FeatureModule, UserModule, AuthModule],
|
||||
tapModule: m => {
|
||||
m.overrideProvider(MailService).useValue(
|
||||
Sinon.createStubInstance(MailService)
|
||||
Sinon.stub(
|
||||
// @ts-expect-error safe
|
||||
new MailService()
|
||||
)
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -71,7 +74,7 @@ test('should be able to sign in with email', async t => {
|
||||
t.is(res.body.email, u1.email);
|
||||
t.true(mailer.sendSignInMail.calledOnce);
|
||||
|
||||
const [signInLink] = mailer.sendSignInMail.firstCall.args;
|
||||
const [, { url: signInLink }] = mailer.sendSignInMail.firstCall.args;
|
||||
const url = new URL(signInLink);
|
||||
const email = url.searchParams.get('email');
|
||||
const token = url.searchParams.get('token');
|
||||
@@ -99,7 +102,7 @@ test('should be able to sign up with email', async t => {
|
||||
t.is(res.body.email, 'u2@affine.pro');
|
||||
t.true(mailer.sendSignUpMail.calledOnce);
|
||||
|
||||
const [signUpLink] = mailer.sendSignUpMail.firstCall.args;
|
||||
const [, { url: signUpLink }] = mailer.sendSignUpMail.firstCall.args;
|
||||
const url = new URL(signUpLink);
|
||||
const email = url.searchParams.get('email');
|
||||
const token = url.searchParams.get('token');
|
||||
|
||||
Reference in New Issue
Block a user