From f15df4409ffa4e2a84799109ed1a67ea1d025549 Mon Sep 17 00:00:00 2001 From: Darcy Ye Date: Mon, 8 Jan 2024 14:45:26 +0800 Subject: [PATCH] chore(connector): remove legacy Test passwordless template type use case (#5205) --- .../connectors/connector-aliyun-dm/src/index.test.ts | 11 ----------- .../connectors/connector-aliyun-sms/src/index.test.ts | 11 ----------- .../connectors/connector-aws-ses/src/index.test.ts | 11 ----------- .../connectors/connector-sendgrid-email/src/mock.ts | 2 +- packages/connectors/connector-smsaero/src/mock.ts | 2 +- .../connector-tencent-sms/src/index.test.ts | 11 ----------- packages/connectors/connector-twilio-sms/src/mock.ts | 2 +- 7 files changed, 3 insertions(+), 47 deletions(-) diff --git a/packages/connectors/connector-aliyun-dm/src/index.test.ts b/packages/connectors/connector-aliyun-dm/src/index.test.ts index e78f1a2b8..a283de41b 100644 --- a/packages/connectors/connector-aliyun-dm/src/index.test.ts +++ b/packages/connectors/connector-aliyun-dm/src/index.test.ts @@ -36,15 +36,4 @@ describe('sendMessage()', () => { expect.anything() ); }); - - it('throws if template is missing', async () => { - const connector = await createConnector({ getConfig }); - await expect( - connector.sendMessage({ - to: 'to@email.com', - type: VerificationCodeType.Test, - payload: { code: '1234' }, - }) - ).rejects.toThrow(); - }); }); diff --git a/packages/connectors/connector-aliyun-sms/src/index.test.ts b/packages/connectors/connector-aliyun-sms/src/index.test.ts index f87b852c8..13e776804 100644 --- a/packages/connectors/connector-aliyun-sms/src/index.test.ts +++ b/packages/connectors/connector-aliyun-sms/src/index.test.ts @@ -73,15 +73,4 @@ describe('sendMessage()', () => { mockedConnectorConfig.accessKeySecret ); }); - - it('throws if template is missing', async () => { - const connector = await createConnector({ getConfig }); - await expect( - connector.sendMessage({ - to: phoneTest, - type: VerificationCodeType.Test, - payload: { code: codeTest }, - }) - ).rejects.toThrow(); - }); }); diff --git a/packages/connectors/connector-aws-ses/src/index.test.ts b/packages/connectors/connector-aws-ses/src/index.test.ts index 436d767c9..d2df1df2d 100644 --- a/packages/connectors/connector-aws-ses/src/index.test.ts +++ b/packages/connectors/connector-aws-ses/src/index.test.ts @@ -53,15 +53,4 @@ describe('sendMessage()', () => { }) ); }); - - it('throws if template is missing', async () => { - const connector = await createConnector({ getConfig }); - await expect( - connector.sendMessage({ - to: 'to@email.com', - type: VerificationCodeType.Test, - payload: { code: '1234' }, - }) - ).rejects.toThrow(); - }); }); diff --git a/packages/connectors/connector-sendgrid-email/src/mock.ts b/packages/connectors/connector-sendgrid-email/src/mock.ts index ccdf1ff67..cf668cafd 100644 --- a/packages/connectors/connector-sendgrid-email/src/mock.ts +++ b/packages/connectors/connector-sendgrid-email/src/mock.ts @@ -26,7 +26,7 @@ export const mockedConfig: SendGridMailConfig = { fromEmail: 'noreply@logto.test.io', templates: [ { - usageType: 'Test', + usageType: 'Generic', type: ContextType.Text, subject: 'Logto Test Template', content: 'This is for testing purposes only. Your verification code is {{code}}.', diff --git a/packages/connectors/connector-smsaero/src/mock.ts b/packages/connectors/connector-smsaero/src/mock.ts index 055f32ace..aa45689b5 100644 --- a/packages/connectors/connector-smsaero/src/mock.ts +++ b/packages/connectors/connector-smsaero/src/mock.ts @@ -10,7 +10,7 @@ export const mockedConfig: SmsAeroConfig = { senderName: mockedSenderName, templates: [ { - usageType: 'Test', + usageType: 'Generic', content: 'This is for testing purposes only. Your verification code is {{code}}.', }, ], diff --git a/packages/connectors/connector-tencent-sms/src/index.test.ts b/packages/connectors/connector-tencent-sms/src/index.test.ts index 9ccab125c..4c58dec68 100644 --- a/packages/connectors/connector-tencent-sms/src/index.test.ts +++ b/packages/connectors/connector-tencent-sms/src/index.test.ts @@ -63,15 +63,4 @@ describe('sendMessage()', () => { }) ); }); - - it('throws if template is missing', async () => { - const connector = await createConnector({ getConfig }); - await expect( - connector.sendMessage({ - to: phoneTest, - type: VerificationCodeType.Test, - payload: { code: codeTest }, - }) - ).rejects.toThrow(); - }); }); diff --git a/packages/connectors/connector-twilio-sms/src/mock.ts b/packages/connectors/connector-twilio-sms/src/mock.ts index fd1f01b7b..b3aabbbcf 100644 --- a/packages/connectors/connector-twilio-sms/src/mock.ts +++ b/packages/connectors/connector-twilio-sms/src/mock.ts @@ -10,7 +10,7 @@ export const mockedConfig: TwilioSmsConfig = { fromMessagingServiceSID: mockedFromMessagingServiceSID, templates: [ { - usageType: 'Test', + usageType: 'Generic', content: 'This is for testing purposes only. Your verification code is {{code}}.', }, ],